Class: Pagseguro::Charge::ErrorMessage
- Inherits:
-
Object
- Object
- Pagseguro::Charge::ErrorMessage
- Defined in:
- lib/pagseguro/charge/error_message.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#description ⇒ Object
Returns the value of attribute description.
-
#info ⇒ Object
Returns the value of attribute info.
-
#message ⇒ Object
Returns the value of attribute message.
-
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize ⇒ ErrorMessage
constructor
A new instance of ErrorMessage.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize ⇒ ErrorMessage
Returns a new instance of ErrorMessage.
11 12 |
# File 'lib/pagseguro/charge/error_message.rb', line 11 def initialize end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/pagseguro/charge/error_message.rb', line 4 def code @code end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/pagseguro/charge/error_message.rb', line 4 def description @description end |
#info ⇒ Object
Returns the value of attribute info.
4 5 6 |
# File 'lib/pagseguro/charge/error_message.rb', line 4 def info @info end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/pagseguro/charge/error_message.rb', line 4 def @message end |
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
4 5 6 |
# File 'lib/pagseguro/charge/error_message.rb', line 4 def parameter_name @parameter_name end |
Class Method Details
.fill_from_json(data) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pagseguro/charge/error_message.rb', line 20 def self.fill_from_json(data) return if data.nil? = new .info = data["info"] .code = data["code"] . = data["message"] .description = data["description"] .parameter_name = data["parameter_name"] end |
Instance Method Details
#as_json(options = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/pagseguro/charge/error_message.rb', line 32 def as_json(={}) { code: @code, message: @message, info: @info, description: @description, parameter_name: @parameter_name } end |
#to_json(*options) ⇒ Object
14 15 16 17 18 |
# File 'lib/pagseguro/charge/error_message.rb', line 14 def to_json(*) hash = as_json(*) hash.reject! {|k,v| v.nil?} hash.to_json(*) end |