Class: Spaceship::ConnectAPI::Territory

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
spaceship/lib/spaceship/connect_api/models/territory.rb

Instance Attribute Summary collapse

Attributes included from Model

#id, #reverse_attr_map

Class Method Summary collapse

Methods included from Model

#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



7
8
9
# File 'spaceship/lib/spaceship/connect_api/models/territory.rb', line 7

def currency
  @currency
end

Class Method Details

.all(client: nil, filter: {}, includes: nil, limit: 180, sort: nil) ⇒ Object

API



21
22
23
24
25
# File 'spaceship/lib/spaceship/connect_api/models/territory.rb', line 21

def self.all(client: nil, filter: {}, includes: nil, limit: 180, sort: nil)
  client ||= Spaceship::ConnectAPI
  resps = client.get_territories(filter: {}, includes: nil, limit: nil, sort: nil).all_pages
  return resps.flat_map(&:to_models)
end

.typeObject



13
14
15
# File 'spaceship/lib/spaceship/connect_api/models/territory.rb', line 13

def self.type
  return "territories"
end