Exception: Subaltern::Command
- Inherits:
-
StandardError
- Object
- StandardError
- Subaltern::Command
- Defined in:
- lib/subaltern/evaluator.rb
Overview
A command like ‘break’ or ‘next’.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.narrow(o) ⇒ Object
Used to circumvent a difference between ruby 1.8 and 1.9…
Instance Method Summary collapse
-
#initialize(name, args) ⇒ Command
constructor
A new instance of Command.
-
#result ⇒ Object
Used by Command.narrow.
Constructor Details
#initialize(name, args) ⇒ Command
Returns a new instance of Command.
156 157 158 159 |
# File 'lib/subaltern/evaluator.rb', line 156 def initialize(name, args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
154 155 156 |
# File 'lib/subaltern/evaluator.rb', line 154 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
154 155 156 |
# File 'lib/subaltern/evaluator.rb', line 154 def name @name end |
Class Method Details
Instance Method Details
#result ⇒ Object
Used by Command.narrow
163 164 165 166 167 168 |
# File 'lib/subaltern/evaluator.rb', line 163 def result return nil if args.empty? return @args.first if args.size == 1 @args end |