Class: RPNCalculator::Result::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/rpn-calculator/result/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorObject (readonly)

Returns the value of attribute error.



13
14
15
# File 'lib/rpn-calculator/result/processor.rb', line 13

def error
  @error
end

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/rpn-calculator/result/processor.rb', line 9

def valid?
  error.nil?
end