Exception: WebToPay::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/webtopay/exception.rb

Constant Summary collapse

E_MISSING =

Missing field.

1
E_INVALID =

Invalid field value.

2
E_MAXLEN =

Max length exceeded.

3
E_REGEXP =

Regexp for field value doesn’t match.

4
E_USER_PARAMS =

Missing or invalid user given parameters.

5
E_LOG =

Logging errors

6
E_SMS_ANSWER =

SMS answer errors

7

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



24
25
26
# File 'lib/webtopay/exception.rb', line 24

def code
  @code
end

#field_nameObject

Returns the value of attribute field_name.



24
25
26
# File 'lib/webtopay/exception.rb', line 24

def field_name
  @field_name
end

Instance Method Details

#as_json(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/webtopay/exception.rb', line 26

def as_json(options = {})
  {
    error: {
      message: message,
      field_name: field_name,
      code: code
    }
  }
end