Class: TroveOAuth::Photo
- Inherits:
-
Object
- Object
- TroveOAuth::Photo
- Defined in:
- lib/trove_oauth/photo.rb
Instance Attribute Summary collapse
-
#album_id ⇒ Object
Returns the value of attribute album_id.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#license ⇒ Object
Returns the value of attribute license.
-
#lng ⇒ Object
Returns the value of attribute lng.
-
#original_web_url ⇒ Object
Returns the value of attribute original_web_url.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#photo_public ⇒ Object
Returns the value of attribute photo_public.
-
#service ⇒ Object
Returns the value of attribute service.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#urls ⇒ Object
Returns the value of attribute urls.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(id, date, original_url) ⇒ Photo
constructor
A new instance of Photo.
- #set_location(lat, lng) ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(id, date, original_url) ⇒ Photo
Returns a new instance of Photo.
5 6 7 8 9 10 |
# File 'lib/trove_oauth/photo.rb', line 5 def initialize(id, date, original_url) self.id = id self.date = date self.urls = {:original => original_url} self. = [] end |
Instance Attribute Details
#album_id ⇒ Object
Returns the value of attribute album_id.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def album_id @album_id end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def date @date end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def description @description end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def id @id end |
#lat ⇒ Object
Returns the value of attribute lat.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def lat @lat end |
#license ⇒ Object
Returns the value of attribute license.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def license @license end |
#lng ⇒ Object
Returns the value of attribute lng.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def lng @lng end |
#original_web_url ⇒ Object
Returns the value of attribute original_web_url.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def original_web_url @original_web_url end |
#owner ⇒ Object
Returns the value of attribute owner.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def owner @owner end |
#photo_public ⇒ Object
Returns the value of attribute photo_public.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def photo_public @photo_public end |
#service ⇒ Object
Returns the value of attribute service.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def service @service end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def title @title end |
#urls ⇒ Object
Returns the value of attribute urls.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def urls @urls end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/trove_oauth/photo.rb', line 3 def width @width end |
Instance Method Details
#set_location(lat, lng) ⇒ Object
12 13 14 15 |
# File 'lib/trove_oauth/photo.rb', line 12 def set_location(lat, lng) self.lat = lat self.lng = lng end |
#to_json ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/trove_oauth/photo.rb', line 17 def to_json { 'album_id' => album_id, 'date' => date.to_s, 'description' => description, 'height' => height, 'id' => id, 'license' => license, 'loc' => [lat, lng], 'original_web_url' => original_web_url, 'owner' => owner, 'public' => photo_public, 'service' => service, 'tags' => , 'title' => title, 'urls' => urls, 'width' => width }.to_json end |