Class: Insightly::Country

Inherits:
ReadOnly show all
Defined in:
lib/insightly/country.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ReadOnly

#==, build, #config, #get_collection, #initialize, #process, #remote_data

Methods inherited from Base

#==, all, api_field, build, #config, custom_fields, #get_collection, #initialize, #load, #process, #reload, #remote_data, #remote_id, #to_json, #url_base

Constructor Details

This class inherits a constructor from Insightly::ReadOnly

Class Method Details

.canadaObject



17
18
19
# File 'lib/insightly/country.rb', line 17

def self.canada
  self.build("Canada")
end

.usObject



14
15
16
# File 'lib/insightly/country.rb', line 14

def self.us
  self.build("United States")
end

Instance Method Details

#build(data) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/insightly/country.rb', line 6

def build(data)
  if data.respond_to? :keys
    @data = data
  else
    @data = {"COUNTRY_NAME" => data}
  end
  self
end