Class: ZohoHub::Account

Inherits:
BaseRecord show all
Defined in:
lib/zoho_hub/records/account.rb

Constant Summary collapse

CATCH_ALL_ID =

This is the ID to be used when the borrower has no organisation (unlikely) or belongs to multiple organisations.

'78265000000826001'
DEFAULTS =
{
  account_type: 'Prospect'
}.freeze

Instance Method Summary collapse

Methods inherited from BaseRecord

all, attribute_translation, attributes, #attributes, #build_response, build_response, create, exists?, find, find_by, #get, get, #new_record?, post, #post, put, #put, request_path, #save, #to_input, where, zoho_key_translation

Constructor Details

#initialize(params) ⇒ Account

Returns a new instance of Account.



29
30
31
32
33
34
35
# File 'lib/zoho_hub/records/account.rb', line 29

def initialize(params)
  attributes.each do |attr|
    zoho_key = attr_to_zoho_key(attr)

    send("#{attr}=", params[zoho_key] || params[attr] || DEFAULTS[attr])
  end
end

Instance Method Details

#to_paramsObject



37
38
39
40
41
# File 'lib/zoho_hub/records/account.rb', line 37

def to_params
  params = super

  params
end