Class: RubyReactor::Template::Input
- Defined in:
- lib/ruby_reactor/template/input.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(name, path = nil) ⇒ Input
constructor
A new instance of Input.
- #inspect ⇒ Object
- #resolve(context) ⇒ Object
Constructor Details
#initialize(name, path = nil) ⇒ Input
Returns a new instance of Input.
8 9 10 11 12 |
# File 'lib/ruby_reactor/template/input.rb', line 8 def initialize(name, path = nil) super() @name = name @path = path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ruby_reactor/template/input.rb', line 6 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/ruby_reactor/template/input.rb', line 6 def path @path end |
Instance Method Details
#inspect ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/ruby_reactor/template/input.rb', line 25 def inspect if @path "input(:#{@name}, #{@path.inspect})" else "input(:#{@name})" end end |
#resolve(context) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_reactor/template/input.rb', line 14 def resolve(context) value = context.get_input(@name) return nil if value.nil? if @path extract_path(value, @path) else value end end |