Class: Render::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/render/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties = {}) ⇒ Generator

Returns a new instance of Generator.



7
8
9
10
11
# File 'lib/render/generator.rb', line 7

def initialize(properties = {})
  properties.symbolize_keys!
  %w(type matcher algorithm).each { |attribute| self.__send__("#{attribute}=", properties[attribute.to_sym]) }
  raise Errors::Generator::MalformedAlgorithm.new(algorithm) if !algorithm.respond_to?(:call)
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



5
6
7
# File 'lib/render/generator.rb', line 5

def algorithm
  @algorithm
end

#matcherObject

Returns the value of attribute matcher.



5
6
7
# File 'lib/render/generator.rb', line 5

def matcher
  @matcher
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/render/generator.rb', line 5

def type
  @type
end