Class: Jop
- Inherits:
-
Object
- Object
- Jop
- Defined in:
- lib/jop.rb
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #advance(amount) ⇒ Object
- #eval_on(ary) ⇒ Object
-
#initialize(command_text) ⇒ Jop
constructor
A new instance of Jop.
Constructor Details
Instance Attribute Details
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
262 263 264 |
# File 'lib/jop.rb', line 262 def tokens @tokens end |
Instance Method Details
#advance(amount) ⇒ Object
269 270 271 |
# File 'lib/jop.rb', line 269 def advance amount @tokens = @tokens[amount...@tokens.length] end |
#eval_on(ary) ⇒ Object
273 274 275 276 277 278 279 |
# File 'lib/jop.rb', line 273 def eval_on ary result = ary while not @tokens.empty? result = eval_op(result) end result end |