Class: Access::Location

Inherits:
Object
  • Object
show all
Includes:
MuchMeta
Defined in:
lib/access/location.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MuchMeta

#set_up_methods, #set_values

Constructor Details

#initialize(values) ⇒ Location

Returns a new instance of Location.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/access/location.rb', line 17

def initialize(values)
  @used_fields = []
  set_up_methods(values)
  set_values(values)

  @links = Access::Link.new(@links) if @links
  @location_store = Access::Store.new(@location_store) if @location_store
  @location_categories = Access::Category.process_batch(@location_categories) if @location_categories
  @physical_location = Access::Location.new(@physical_location) if @physical_location
  @geolocation = Geolocation.new(@geolocation) if @geolocation
end

Class Method Details

.find(location_key, options = {}) ⇒ Object



9
10
11
# File 'lib/access/location.rb', line 9

def self.find(location_key, options = {})
  Access::Api.new.find_location location_key, options
end

.process_batch(chunk) ⇒ Object



13
14
15
# File 'lib/access/location.rb', line 13

def self.process_batch(chunk)
  chunk.map { |location| new(location) }
end

.search(options = {}) ⇒ Object



5
6
7
# File 'lib/access/location.rb', line 5

def self.search(options = {})
  Access::Api.new.search_locations options
end