Class: Google::Search::Item::Local
- Inherits:
-
Google::Search::Item
- Object
- Google::Search::Item
- Google::Search::Item::Local
- Defined in:
- lib/google-search/item/local.rb
Instance Attribute Summary collapse
-
#accuracy ⇒ Object
readonly
Accuracy.
-
#address_lines ⇒ Object
readonly
Address lines array.
-
#city ⇒ Object
readonly
City.
-
#country ⇒ Object
readonly
Country.
-
#directions_from_here_uri ⇒ Object
readonly
Google maps directions from here uri.
-
#directions_to_here_uri ⇒ Object
readonly
Google maps directions to here uri.
-
#directions_uri ⇒ Object
readonly
Google maps directions uri.
-
#lat ⇒ Object
readonly
Latitude float.
-
#long ⇒ Object
readonly
Longitude float.
-
#max_age ⇒ Object
readonly
Max age in seconds.
-
#phone_numbers ⇒ Object
readonly
Phone numbers array.
-
#region ⇒ Object
readonly
Region.
-
#street_address ⇒ Object
readonly
Street address.
-
#type ⇒ Object
readonly
Type.
-
#viewport_mode ⇒ Object
readonly
Viewport mode.
Attributes inherited from Google::Search::Item
#content, #index, #thumbnail_height, #thumbnail_uri, #thumbnail_width, #title, #uri, #visible_uri
Instance Method Summary collapse
-
#initialize(hash) ⇒ Local
constructor
Initialize with hash.
Methods inherited from Google::Search::Item
Constructor Details
#initialize(hash) ⇒ Local
Initialize with hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/google-search/item/local.rb', line 85 def initialize hash super @country = hash['country'] @region = hash['region'] @city = hash['city'] @type = hash['listingType'] @accuracy = hash['accuracy'].to_i @max_age = hash['maxAge'] @directions_uri = hash['ddUrl'] @directions_to_here_uri = hash['ddUrlToHere'] @directions_from_here_uri = hash['ddUrlFromHere'] @thumbnail_uri = hash['staticMapUrl'] @long = hash['lng'].to_f @lat = hash['lat'].to_f @viewport_mode = hash['viewportmode'] @phone_numbers = hash['phoneNumbers'].map { |phone| phone['number'] } @street_address = hash['streetAddress'] @address_lines = hash['addressLines'] end |
Instance Attribute Details
#accuracy ⇒ Object (readonly)
Accuracy.
30 31 32 |
# File 'lib/google-search/item/local.rb', line 30 def accuracy @accuracy end |
#address_lines ⇒ Object (readonly)
Address lines array.
80 81 82 |
# File 'lib/google-search/item/local.rb', line 80 def address_lines @address_lines end |
#city ⇒ Object (readonly)
City.
20 21 22 |
# File 'lib/google-search/item/local.rb', line 20 def city @city end |
#country ⇒ Object (readonly)
Country.
10 11 12 |
# File 'lib/google-search/item/local.rb', line 10 def country @country end |
#directions_from_here_uri ⇒ Object (readonly)
Google maps directions from here uri.
50 51 52 |
# File 'lib/google-search/item/local.rb', line 50 def directions_from_here_uri @directions_from_here_uri end |
#directions_to_here_uri ⇒ Object (readonly)
Google maps directions to here uri.
45 46 47 |
# File 'lib/google-search/item/local.rb', line 45 def directions_to_here_uri @directions_to_here_uri end |
#directions_uri ⇒ Object (readonly)
Google maps directions uri.
40 41 42 |
# File 'lib/google-search/item/local.rb', line 40 def directions_uri @directions_uri end |
#lat ⇒ Object (readonly)
Latitude float.
60 61 62 |
# File 'lib/google-search/item/local.rb', line 60 def lat @lat end |
#long ⇒ Object (readonly)
Longitude float.
55 56 57 |
# File 'lib/google-search/item/local.rb', line 55 def long @long end |
#max_age ⇒ Object (readonly)
Max age in seconds.
35 36 37 |
# File 'lib/google-search/item/local.rb', line 35 def max_age @max_age end |
#phone_numbers ⇒ Object (readonly)
Phone numbers array.
70 71 72 |
# File 'lib/google-search/item/local.rb', line 70 def phone_numbers @phone_numbers end |
#region ⇒ Object (readonly)
Region.
15 16 17 |
# File 'lib/google-search/item/local.rb', line 15 def region @region end |
#street_address ⇒ Object (readonly)
Street address.
75 76 77 |
# File 'lib/google-search/item/local.rb', line 75 def street_address @street_address end |
#type ⇒ Object (readonly)
Type.
25 26 27 |
# File 'lib/google-search/item/local.rb', line 25 def type @type end |
#viewport_mode ⇒ Object (readonly)
Viewport mode.
65 66 67 |
# File 'lib/google-search/item/local.rb', line 65 def @viewport_mode end |