Class: ComponentEmbeddedRuby::Eval

Inherits:
Object
  • Object
show all
Defined in:
lib/component_embedded_ruby/eval.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#outputObject (readonly)

Returns the value of attribute output.



5
6
7
# File 'lib/component_embedded_ruby/eval.rb', line 5

def output
  @output
end

#valueObject (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