Class: Rodakase::Transaction::Matcher::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/rodakase/transaction/matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Error

Returns a new instance of Error.



9
10
11
# File 'lib/rodakase/transaction/matcher.rb', line 9

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



7
8
9
# File 'lib/rodakase/transaction/matcher.rb', line 7

def result
  @result
end

Instance Method Details

#on(code) {|result.value| ... } ⇒ Object

Yields:



13
14
15
# File 'lib/rodakase/transaction/matcher.rb', line 13

def on(code, &block)
  yield(result.value) if result.code == code
end