Created
September 15, 2009 22:37
-
-
Save sigmonsays/187723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Disk | |
class Collector | |
include Enumerable | |
def initialize(args) | |
@platform = args[:platform] | |
puts "#{self} platform #{@platform}" | |
# how do I include Disk::Collector::Linux ??? | |
end | |
def each_disk | |
%w{ a b c }.each do |n| | |
disk = {} | |
disk[ :name ] = "name-#{n}" | |
disk[ :type ] = "type-#{n}" | |
yield disk | |
end | |
end | |
end | |
end | |
class Disk | |
class Collector | |
class Linux | |
def each_disk | |
end | |
end | |
end | |
end | |
Disk::Collector.new( :platform => :linux ).each_disk do |disk| | |
puts "#{disk[:name]} #{disk[:type]}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment