Class: Diggr::Photo

Inherits:
Object
  • Object
show all
Defined in:
lib/diggr/response_classes/photo.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def comments
  @comments
end

#contentTypeObject

Returns the value of attribute contentType.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def contentType
  @contentType
end

#heightObject

Returns the value of attribute height.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def height
  @height
end

#hrefObject

Returns the value of attribute href.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def href
  @href
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def id
  @id
end

#originalheightObject

Returns the value of attribute originalheight.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def originalheight
  @originalheight
end

#originalwidthObject

Returns the value of attribute originalwidth.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def originalwidth
  @originalwidth
end

#srcObject

Returns the value of attribute src.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def src
  @src
end

#submit_dateObject

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

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def title
  @title
end

#userObject

Returns the value of attribute user.



7
8
9
# File 'lib/diggr/response_classes/photo.rb', line 7

def user
  @user
end

#widthObject

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