Class: Prosper::Api::Conta
- Inherits:
-
Object
- Object
- Prosper::Api::Conta
- Includes:
- HTTParty
- Defined in:
- lib/prosper/api/conta.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#errors ⇒ Object
Returns the value of attribute errors.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Conta
constructor
A new instance of Conta.
- #load! ⇒ Object
- #method_missing(m, *args, &block) ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Conta
Returns a new instance of Conta.
15 16 17 |
# File 'lib/prosper/api/conta.rb', line 15 def initialize(attributes = {}) self.attributes = attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
47 48 49 |
# File 'lib/prosper/api/conta.rb', line 47 def method_missing(m, *args, &block) self.attributes[m.to_sym] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
12 13 14 |
# File 'lib/prosper/api/conta.rb', line 12 def attributes @attributes end |
#errors ⇒ Object
Returns the value of attribute errors.
13 14 15 |
# File 'lib/prosper/api/conta.rb', line 13 def errors @errors end |
Class Method Details
Instance Method Details
#load! ⇒ Object
43 44 45 |
# File 'lib/prosper/api/conta.rb', line 43 def load! self.attributes = Conta.find(self.attributes[:id]).attributes end |
#save ⇒ Object
19 20 21 |
# File 'lib/prosper/api/conta.rb', line 19 def save self.attributes = self.class.post("/api/contas", :body => {:lancamento_financeiro => self.attributes}).parsed_response.symbolize_keys end |