Class: Diggr::Story
- Inherits:
-
Object
- Object
- Diggr::Story
- Defined in:
- lib/diggr/response_classes/story.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#container ⇒ Object
Returns the value of attribute container.
-
#description ⇒ Object
Returns the value of attribute description.
-
#diggs ⇒ Object
Returns the value of attribute diggs.
-
#href ⇒ Object
Returns the value of attribute href.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link ⇒ Object
Returns the value of attribute link.
-
#media ⇒ Object
Returns the value of attribute media.
-
#shorturl ⇒ Object
Returns the value of attribute shorturl.
-
#status ⇒ Object
Returns the value of attribute status.
-
#submit_date ⇒ Object
Returns the value of attribute submit_date.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def comments @comments end |
#container ⇒ Object
Returns the value of attribute container.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def container @container end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def description @description end |
#diggs ⇒ Object
Returns the value of attribute diggs.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def diggs @diggs end |
#href ⇒ Object
Returns the value of attribute href.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def href @href end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def link @link end |
#media ⇒ Object
Returns the value of attribute media.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def media @media end |
#shorturl ⇒ Object
Returns the value of attribute shorturl.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def shorturl @shorturl end |
#status ⇒ Object
Returns the value of attribute status.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def status @status end |
#submit_date ⇒ Object
Returns the value of attribute submit_date.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def submit_date @submit_date end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def title @title end |
#topic ⇒ Object
Returns the value of attribute topic.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def topic @topic end |
#user ⇒ Object
Returns the value of attribute user.
11 12 13 |
# File 'lib/diggr/response_classes/story.rb', line 11 def user @user end |
Class Method Details
.new_from_parsed_json(data) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/diggr/response_classes/story.rb', line 14 def self.new_from_parsed_json(data) story = Story.new %w(id link submit_date diggs comments title description status media href).each do |attribute| story.send("#{attribute}=",data[attribute]) if data[attribute] end story.user = Diggr::User.new_from_parsed_json(data['user']) if data['user'] story.topic = Diggr::Topic.new_from_parsed_json(data['topic']) if data['topic'] story.container = Diggr::Container.new_from_parsed_json(data['container']) if data['container'] story.thumbnail = Diggr::Photo.new_from_parsed_json(data['thumbnail']) if data['thumbnail'] story.shorturl = Diggr::ShortUrl.new_from_parsed_json(data['shorturl'][0]) if data['shorturl'] story end |