Class: RubyReactor::Template::Element

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_reactor/template/element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(map_name, path = nil) ⇒ Element

Returns a new instance of Element.



8
9
10
11
12
# File 'lib/ruby_reactor/template/element.rb', line 8

def initialize(map_name, path = nil)
  super()
  @map_name = map_name
  @path = path
end

Instance Attribute Details

#map_nameObject (readonly)

Returns the value of attribute map_name.



6
7
8
# File 'lib/ruby_reactor/template/element.rb', line 6

def map_name
  @map_name
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/ruby_reactor/template/element.rb', line 6

def path
  @path
end

Instance Method Details

#inspectObject



20
21
22
# File 'lib/ruby_reactor/template/element.rb', line 20

def inspect
  "element(:#{@map_name}#{", #{@path.inspect}" if @path})"
end

#resolve(_context) ⇒ Object



14
15
16
17
18
# File 'lib/ruby_reactor/template/element.rb', line 14

def resolve(_context)
  # Element resolution happens inside MapStep, not generic resolve
  # But if called in wrong context, raise error
  raise RubyReactor::Error::DependencyError, "element() can only be used within a map argument mapping"
end