Class: Podio::ContractAccounting

Inherits:
ActivePodio::Base show all
Includes:
ActivePodio::Updatable
Defined in:
lib/podio/models/contract_accounting.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes, #error_code, #error_message, #error_parameters, #error_propagate

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, list, member, #new_record?, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.find(contract_id) ⇒ Object



21
22
23
# File 'lib/podio/models/contract_accounting.rb', line 21

def find(contract_id)
  member Podio.connection.get("/contract/#{contract_id}/accounting").body
end

.update(contract_id, attributes) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/podio/models/contract_accounting.rb', line 25

def update(contract_id, attributes)
  response = Podio.connection.put do |req|
    req.url "/contract/#{contract_id}/accounting"
    req.body = attributes
  end
  response.status
end

Instance Method Details

#updateObject



16
17
18
# File 'lib/podio/models/contract_accounting.rb', line 16

def update
  self.class.update(self.contract_id, self.attributes)
end