Class: Diggr::Photo
- Inherits:
-
Object
- Object
- Diggr::Photo
- Defined in:
- lib/diggr/response_classes/photo.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#contentType ⇒ Object
Returns the value of attribute contentType.
-
#height ⇒ Object
Returns the value of attribute height.
-
#href ⇒ Object
Returns the value of attribute href.
-
#id ⇒ Object
Returns the value of attribute id.
-
#originalheight ⇒ Object
Returns the value of attribute originalheight.
-
#originalwidth ⇒ Object
Returns the value of attribute originalwidth.
-
#src ⇒ Object
Returns the value of attribute src.
-
#submit_date ⇒ Object
Returns the value of attribute submit_date.
-
#title ⇒ Object
Returns the value of attribute title.
-
#user ⇒ Object
Returns the value of attribute user.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def comments @comments end |
#contentType ⇒ Object
Returns the value of attribute contentType.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def contentType @contentType end |
#height ⇒ Object
Returns the value of attribute height.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def height @height end |
#href ⇒ Object
Returns the value of attribute href.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def href @href end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def id @id end |
#originalheight ⇒ Object
Returns the value of attribute originalheight.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def originalheight @originalheight end |
#originalwidth ⇒ Object
Returns the value of attribute originalwidth.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def originalwidth @originalwidth end |
#src ⇒ Object
Returns the value of attribute src.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def src @src end |
#submit_date ⇒ Object
Returns the value of attribute submit_date.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def submit_date @submit_date end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def title @title end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def user @user end |
#width ⇒ Object
Returns the value of attribute width.
7 8 9 |
# File 'lib/diggr/response_classes/photo.rb', line 7 def width @width end |
Class Method Details
.new_from_parsed_json(data) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/diggr/response_classes/photo.rb', line 10 def self.new_from_parsed_json(data) photo = Photo.new data.each do |key,val| unless key == 'user' photo.send("#{key}=",val) end end if data.has_key? 'user' photo.user = Diggr::User.new_from_parsed_json(data['user']) end photo end |