class Sberbank::Acquiring::CommandResponseDecorator
Attributes
response[R]
Public Class Methods
new(response)
click to toggle source
# File lib/sberbank/acquiring/command_response_decorator.rb, line 14 def initialize(response) @response = response end
Public Instance Methods
error?()
click to toggle source
# File lib/sberbank/acquiring/command_response_decorator.rb, line 18 def error? data.nil? || data['errorCode'].to_i > 0 end
method_missing(name, *attrs)
click to toggle source
Calls superclass method
# File lib/sberbank/acquiring/command_response_decorator.rb, line 26 def method_missing(name, *attrs) key = camelize_string(name.to_s) data.key?(key) ? data[key] : super end
success?()
click to toggle source
# File lib/sberbank/acquiring/command_response_decorator.rb, line 22 def success? !error? end
Private Instance Methods
camelize_string(string)
click to toggle source
# File lib/sberbank/acquiring/command_response_decorator.rb, line 33 def camelize_string(string) string.gsub(/_([a-z])/) { $1.upcase } end