Class: LunaApi::Store

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/luna_api/store.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject



4
5
6
7
8
9
10
11
12
# File 'lib/luna_api/store.rb', line 4

def self.all
  response = LunaApi::Request.get("http://wholesale.lunasandals.com/api/stores")
  s = JSON.parse(response.body)
  s.each do |country, list|
    list.each do |state, stores|
      s[country][state] = stores.map { |store| self.new(store)}
    end
  end
end

Instance Method Details

#street_oneObject



14
15
16
# File 'lib/luna_api/store.rb', line 14

def street_one
  self.address_one
end

#street_twoObject



18
19
20
# File 'lib/luna_api/store.rb', line 18

def street_two
  self.address_two
end