Exception: PagarMe::PagarMeError
- Inherits:
-
StandardError
- Object
- StandardError
- PagarMe::PagarMeError
- Defined in:
- lib/pagarme/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#message ⇒ Object
Returns the value of attribute message.
-
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = "", parameter_name = "", type = "", url = "") ⇒ PagarMeError
constructor
A new instance of PagarMeError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = "", parameter_name = "", type = "", url = "") ⇒ PagarMeError
Returns a new instance of PagarMeError.
9 10 11 12 13 14 |
# File 'lib/pagarme/errors.rb', line 9 def initialize( = "", parameter_name = "", type = "", url = "") self. = self.type = type self.parameter_name = parameter_name self.errors = [] end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
7 8 9 |
# File 'lib/pagarme/errors.rb', line 7 def errors @errors end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/pagarme/errors.rb', line 3 def @message end |
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
4 5 6 |
# File 'lib/pagarme/errors.rb', line 4 def parameter_name @parameter_name end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/pagarme/errors.rb', line 5 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/pagarme/errors.rb', line 6 def url @url end |
Class Method Details
.initFromServerResponse(response = {}) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/pagarme/errors.rb', line 16 def self.initFromServerResponse(response = {}) object = self.new response['errors'].map do |error| object. += error['message'] + ', ' object.errors << PagarMeError.new(error['message'], error['parameter_name'], error['type'], response['url']) end object end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/pagarme/errors.rb', line 25 def to_s "#{self.class.to_s} - #{}" end |