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.
-
#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.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def comments @comments end |
#container ⇒ Object
Returns the value of attribute container.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def container @container end |
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def description @description end |
#diggs ⇒ Object
Returns the value of attribute diggs.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def diggs @diggs end |
#href ⇒ Object
Returns the value of attribute href.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def href @href end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def link @link end |
#media ⇒ Object
Returns the value of attribute media.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def media @media end |
#status ⇒ Object
Returns the value of attribute status.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def status @status end |
#submit_date ⇒ Object
Returns the value of attribute submit_date.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def submit_date @submit_date end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def title @title end |
#topic ⇒ Object
Returns the value of attribute topic.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def topic @topic end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/diggr/response_classes/story.rb', line 10 def user @user end |
Class Method Details
.new_from_parsed_json(data) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/diggr/response_classes/story.rb', line 13 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 end |