Class: ComponentEmbeddedRuby::Eval
- Inherits:
-
Object
- Object
- ComponentEmbeddedRuby::Eval
- Defined in:
- lib/component_embedded_ruby/eval.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eval(binding) ⇒ Object
-
#initialize(value, output: true) ⇒ Eval
constructor
A new instance of Eval.
Constructor Details
#initialize(value, output: true) ⇒ Eval
Returns a new instance of Eval.
7 8 9 10 |
# File 'lib/component_embedded_ruby/eval.rb', line 7 def initialize(value, output: true) @value = value @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
5 6 7 |
# File 'lib/component_embedded_ruby/eval.rb', line 5 def output @output end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/component_embedded_ruby/eval.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/component_embedded_ruby/eval.rb', line 16 def ==(other) other.value == value end |
#eval(binding) ⇒ Object
12 13 14 |
# File 'lib/component_embedded_ruby/eval.rb', line 12 def eval(binding) binding.instance_eval(value) end |