Class: Megatest::Runtime::Expression
- Inherits:
-
Object
- Object
- Megatest::Runtime::Expression
- Defined in:
- lib/megatest/runtime.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(string, block) ⇒ Expression
constructor
A new instance of Expression.
Constructor Details
#initialize(string, block) ⇒ Expression
Returns a new instance of Expression.
167 168 169 170 |
# File 'lib/megatest/runtime.rb', line 167 def initialize(string, block) @string = string @block = block end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
165 166 167 |
# File 'lib/megatest/runtime.rb', line 165 def string @string end |
Instance Method Details
#call ⇒ Object
172 173 174 |
# File 'lib/megatest/runtime.rb', line 172 def call eval(@string, @block.binding) end |