Class: Conductor::Export
- Inherits:
-
Object
- Object
- Conductor::Export
- Defined in:
- lib/conductor/export.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #export(export_value = nil) ⇒ Object
-
#initialize(options = {}) ⇒ Export
constructor
A new instance of Export.
Constructor Details
#initialize(options = {}) ⇒ Export
Returns a new instance of Export.
5 6 7 8 9 |
# File 'lib/conductor/export.rb', line 5 def initialize(={}) @id = .fetch(:id) @value = .fetch(:value) @context = .fetch(:context) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/conductor/export.rb', line 3 def context @context end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/conductor/export.rb', line 3 def id @id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/conductor/export.rb', line 3 def value @value end |
Instance Method Details
#export(export_value = nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/conductor/export.rb', line 11 def export(export_value=nil) if value.is_a? Proc context.instance_eval { value.call exported_value } else value end end |