Class: LeaflyApiWrapper::Location
- Inherits:
-
Object
- Object
- LeaflyApiWrapper::Location
- Defined in:
- lib/leafly_api_wrapper/location.rb
Instance Attribute Summary collapse
-
#ada ⇒ Object
readonly
Returns the value of attribute ada.
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#atm ⇒ Object
readonly
Returns the value of attribute atm.
-
#canadaLP ⇒ Object
readonly
Returns the value of attribute canadaLP.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#creditCards ⇒ Object
readonly
Returns the value of attribute creditCards.
-
#delivery ⇒ Object
readonly
Returns the value of attribute delivery.
-
#desription ⇒ Object
readonly
Returns the value of attribute desription.
-
#facebookUrl ⇒ Object
readonly
Returns the value of attribute facebookUrl.
-
#googlePlusUrl ⇒ Object
readonly
Returns the value of attribute googlePlusUrl.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#instagramUrl ⇒ Object
readonly
Returns the value of attribute instagramUrl.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#logo ⇒ Object
readonly
Returns the value of attribute logo.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#medical ⇒ Object
readonly
Returns the value of attribute medical.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#photos ⇒ Object
readonly
Returns the value of attribute photos.
-
#pinterestUrl ⇒ Object
readonly
Returns the value of attribute pinterestUrl.
-
#retail ⇒ Object
readonly
Returns the value of attribute retail.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#specials ⇒ Object
readonly
Returns the value of attribute specials.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#storefront ⇒ Object
readonly
Returns the value of attribute storefront.
-
#tagLine ⇒ Object
readonly
Returns the value of attribute tagLine.
-
#tagLineBlurb ⇒ Object
readonly
Returns the value of attribute tagLineBlurb.
-
#tumblrUrl ⇒ Object
readonly
Returns the value of attribute tumblrUrl.
-
#twitterUrl ⇒ Object
readonly
Returns the value of attribute twitterUrl.
-
#veteranDiscount ⇒ Object
readonly
Returns the value of attribute veteranDiscount.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(data) ⇒ Location
Returns a new instance of Location.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/leafly_api_wrapper/location.rb', line 16 def initialize(data) @id = data['id'] @slug = data['slug'] @name = data['name'] @atm = data['atm'] @creditCards = data['creditCards'] @veteranDiscount = data['veteranDiscount'] @ada = data['ada'] @delivery = data['delivery'] @retail = data['retail'] @medical = data['medical'] @storefront = data['storefront'] @logo = data['logo'] @address = data['address'] @city = data['city'] @state = data['state'] @zip = data['zip'] @phone = data['phone'] @hours = data['hours'] @website = data['website'] @desription = data['desription'] @latitude = data['latitude'] @longitude = data['longitude'] @photos = data['photos'] @permalink = data['permalink'] @canadaLP = data['canadaLP'] @tagLine = data['tagLine'] @tagLineBlurb = data['tagLineBlurb'] @facebookUrl = data['facebookUrl'] @twitterUrl = data['twitterUrl'] @googlePlusUrl = data['googlePlusUrl'] @pinterestUrl = data['pinterestUrl'] @tumblrUrl = data['tumblrUrl'] @instagramUrl = data['instagramUrl'] @specials = data['specials'] end |
Instance Attribute Details
#ada ⇒ Object (readonly)
Returns the value of attribute ada.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def ada @ada end |
#address ⇒ Object (readonly)
Returns the value of attribute address.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def address @address end |
#atm ⇒ Object (readonly)
Returns the value of attribute atm.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def atm @atm end |
#canadaLP ⇒ Object (readonly)
Returns the value of attribute canadaLP.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def canadaLP @canadaLP end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def city @city end |
#creditCards ⇒ Object (readonly)
Returns the value of attribute creditCards.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def creditCards @creditCards end |
#delivery ⇒ Object (readonly)
Returns the value of attribute delivery.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def delivery @delivery end |
#desription ⇒ Object (readonly)
Returns the value of attribute desription.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def desription @desription end |
#facebookUrl ⇒ Object (readonly)
Returns the value of attribute facebookUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def facebookUrl @facebookUrl end |
#googlePlusUrl ⇒ Object (readonly)
Returns the value of attribute googlePlusUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def googlePlusUrl @googlePlusUrl end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def hours @hours end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def id @id end |
#instagramUrl ⇒ Object (readonly)
Returns the value of attribute instagramUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def instagramUrl @instagramUrl end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def latitude @latitude end |
#logo ⇒ Object (readonly)
Returns the value of attribute logo.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def logo @logo end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def longitude @longitude end |
#medical ⇒ Object (readonly)
Returns the value of attribute medical.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def medical @medical end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def name @name end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def permalink @permalink end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def phone @phone end |
#photos ⇒ Object (readonly)
Returns the value of attribute photos.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def photos @photos end |
#pinterestUrl ⇒ Object (readonly)
Returns the value of attribute pinterestUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def pinterestUrl @pinterestUrl end |
#retail ⇒ Object (readonly)
Returns the value of attribute retail.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def retail @retail end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def slug @slug end |
#specials ⇒ Object (readonly)
Returns the value of attribute specials.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def specials @specials end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def state @state end |
#storefront ⇒ Object (readonly)
Returns the value of attribute storefront.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def storefront @storefront end |
#tagLine ⇒ Object (readonly)
Returns the value of attribute tagLine.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def tagLine @tagLine end |
#tagLineBlurb ⇒ Object (readonly)
Returns the value of attribute tagLineBlurb.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def tagLineBlurb @tagLineBlurb end |
#tumblrUrl ⇒ Object (readonly)
Returns the value of attribute tumblrUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def tumblrUrl @tumblrUrl end |
#twitterUrl ⇒ Object (readonly)
Returns the value of attribute twitterUrl.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def twitterUrl @twitterUrl end |
#veteranDiscount ⇒ Object (readonly)
Returns the value of attribute veteranDiscount.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def veteranDiscount @veteranDiscount end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def website @website end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
7 8 9 |
# File 'lib/leafly_api_wrapper/location.rb', line 7 def zip @zip end |
Class Method Details
.get(slug) ⇒ Object
67 68 69 70 71 72 |
# File 'lib/leafly_api_wrapper/location.rb', line 67 def self.get(slug) res = connection.get "/locations/#{slug}" raw_data = JSON.parse(res.body) data = LeaflyApiWrapper::Mapper.new(raw_data, 'location_detail').mapped new(data) end |
.near(lat, lon, options = {}) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/leafly_api_wrapper/location.rb', line 53 def self.near(lat, lon, = {}) response = connection.post '/locations', { page: 0, take: 50, latitude: lat, longitude: lon }.merge() JSON.parse(response.body)['stores'].collect do |raw_data| data = LeaflyApiWrapper::Mapper.new(raw_data, 'location_search').mapped new(data) end end |