Class: FMyLife::Story
Overview
Story
Encapsulates a story on fmylife.com. These are primary used for reading stories off the site, but it can be used to submit stories as well. An example:
fml = FMyLife.new("apikeyhere")
story = FMyLife::Story.new(:author => "Anonymous",
:category => :love,
:text => "blah blah blah. FML")
fml.submit(story)
To read one, simple use it’s variables:
story = fml.latest.first
= story.
text = story.text
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Story
constructor
Initialize a new story.
Methods inherited from XMLStruct
field, #parse_xml, #post_initialize
Methods included from CanParse
#xml_attribute, #xml_content, #xml_doc, #xpath
Constructor Details
#initialize(opts = {}) ⇒ Story
Initialize a new story. Available options are:
- :author
-
The name of the author
- :category
-
The category (must be from FMyLife::AVAILABLE_CATEGORIES)
- :text
-
The text of the submissions
429 |
# File 'lib/fmylife.rb', line 429 def initialize(opts = {}); super(opts); end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
412 413 414 |
# File 'lib/fmylife.rb', line 412 def comments @comments end |