18 Nov '13, 7pm

Found this interesting and helpful in regards to ruby private methods and unit testing.

class Book def initialize(name) @name = name end def available_for_purchase? copies_remaining > 0 end private def copies_remaining Inventory.count(:book, @name) end end module Inventory extend self def count(item_type, name) item_class(item_type).find_by_name(name).quantity end def receive(item_type, name, quantity) item_class(item_type).create(name, quantity) end private def item_class(item_type) case item_type when :book InStockBook when :video InStockVideo end end end class InStockBook def self.titles @titles ||= {} end def self.find_by_name(name) titles[name] end def self.create(name, quantity) titles[name] = new(name, quantity) end def initialize(name, quantity) @title = name @quantity = quantity end attr_reader :title, :quantity def isbn @isbn ||= isbn_from_service end private def isbn_from_service isbn_service_connect isbn = @isbn_service.find_isbn_for(@title) isbn_...

Full article: http://blog.rubybestpractices.com/posts/gregory/034-issue...

Tweets

PPC Testing #seo via @seobook

seobook.com 17 Nov '13, 8am

If your customer's website is brand new you may want to include a Google AdWords test budget in your SEO package for new c...

Here's How to Stuff a Private Jet Into a Holiday Stocking

Here's How to Stuff a Private Jet Into a Holida...

justluxe.com 18 Nov '13, 9pm

is getting in the holiday spirit by preparing several different exclusive gift ideas for their jetsetting customers. If yo...

Meet the innovators—and LUSH Prize recipients—who are leading the charge against animal testing

Meet the innovators—and LUSH Prize recipients—w...

ecouterre.com 19 Nov '13, 11pm

raised the bar from being a cruelty-free cosmetics company and became an assertive innovative toward permanently ending an...

Animal Testing Phase-Out in China (sort of) - Feelgood Style: Animal Testing Phase-Out in China (sort of)Feelg...

Animal Testing Phase-Out in China (sort of) - F...

feelgoodstyle.com 18 Nov '13, 12pm

Great news for animal rights! China is phasing out mandatory animal testing on domestic beauty products! This is absolutel...

AppNote: Testing LTE-Advanced 1

rohde-schwarz.com 16 Nov '13, 11am

LTE-Advanced comprises multiple features enhancing the basic LTE technology firstly specified in 3GPP Release 8. LTE inclu...

6 good reasons to travel by private jet

6 good reasons to travel by private jet

aluxurytravelblog.com 17 Nov '13, 1am

6 good reasons to travel by private jet By Ben Schusterman on Oct 19, 2013 in Air Travel , Speciality Travel - Read 4310 t...

5 Cat Brew Methods The Aeropersian, the Eva Sno...

sprudge.com 15 Nov '13, 7pm

In a perfect world cats and brew methods would be one. Here are five cat breeds brew methods we think we could all use in ...

Coinsetter launches private beta to ‘make bitcoin trading quicker and more flexible’

Coinsetter launches private beta to ‘make bitco...

coindesk.com 14 Nov '13, 10am

New York-based exchange Coinsetter opened up its private beta this week, serving an international audience. CEO Jaron Luka...