class Erector::Dependency

Attributes

options[R]
text[R]
type[R]

Public Class Methods

interpolate(s) click to toggle source
# File lib/erector/dependency.rb, line 11
def self.interpolate(s)
  eval("<<INTERPOLATE\n" + s + "\nINTERPOLATE").chomp
end
new(type, text, options = {}) click to toggle source
# 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

Public Instance Methods

==(other) click to toggle source
# 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
eql?(other) click to toggle source
# File lib/erector/dependency.rb, line 21
def eql?(other)
  self == other
end
hash() click to toggle source
# 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