Class: RPNCalculator::Result::Processor
- Inherits:
-
Object
- Object
- RPNCalculator::Result::Processor
- Defined in:
- lib/rpn-calculator/result/processor.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result = [], error = nil) ⇒ Processor
constructor
A new instance of Processor.
- #valid? ⇒ Boolean
Constructor Details
#initialize(result = [], error = nil) ⇒ Processor
Returns a new instance of Processor.
4 5 6 7 |
# File 'lib/rpn-calculator/result/processor.rb', line 4 def initialize(result = [], error = nil) @result = result @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
13 14 15 |
# File 'lib/rpn-calculator/result/processor.rb', line 13 def error @error end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
13 14 15 |
# File 'lib/rpn-calculator/result/processor.rb', line 13 def result @result end |
Instance Method Details
#valid? ⇒ Boolean
9 10 11 |
# File 'lib/rpn-calculator/result/processor.rb', line 9 def valid? error.nil? end |