# File lib/erector/dependency.rb, line 11 def self.interpolate(s) eval("<<INTERPOLATE\n" + s + "\nINTERPOLATE").chomp end
# File lib/erector/dependency.rb, line 5 def initialize(type, text, options = {}) text = text.read if text.is_a? IO text = self.class.interpolate(text) if options[:interpolate] # todo: test @type, @text, @options = type, text, options end
# File lib/erector/dependency.rb, line 15 def ==(other) (self.type == other.type and self.text == other.text and self.options == other.options) ? true : false end
# File lib/erector/dependency.rb, line 21 def eql?(other) self == other end
# File lib/erector/dependency.rb, line 25 def hash # this is a fairly inefficient hash function but it does the trick for # now "#{type}#{text}#{options}".hash end