Skip to content

Instantly share code, notes, and snippets.

@marcmo
Created April 12, 2010 20:01
Show Gist options
  • Save marcmo/363943 to your computer and use it in GitHub Desktop.
Save marcmo/363943 to your computer and use it in GitHub Desktop.
class BuildingBlock
attr_accessor :name, :base
attr_reader :config, :dependencies
def initialize(config, name)
@name = name
@dependencies = []
@config = config
ALL_BUILDING_BLOCKS[@name] = self
end
def to_s
"#{name} => #{self.class} with base: #{base}"
end
def set_dependencies(ds)
deps = ds.inject([]) do |acc,d|
if (d.instance_of?(BinaryLibrary))
puts "#{d} was a binary lib, adding #{d.name}"
acc << d.name
else
acc << d
end
end
@dependencies = deps
self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment