Class: JustGiving::Response
- Inherits:
-
Object
- Object
- JustGiving::Response
- Defined in:
- lib/just_giving/response.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #any? ⇒ Boolean
-
#initialize(errors) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(errors) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/just_giving/response.rb', line 4 def initialize(errors) @errors = [] errors.each{|e| @errors << Hashie::Mash.new(e)} end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/just_giving/response.rb', line 3 def errors @errors end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/just_giving/response.rb', line 13 def [](key) if respond_to?(key.to_sym) send(key.to_sym) else nil end end |
#any? ⇒ Boolean
9 10 11 |
# File 'lib/just_giving/response.rb', line 9 def any? errors.any? end |