Created
April 12, 2010 20:01
-
-
Save marcmo/363943 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 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