Class: Preposterous::Post
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#autopost ⇒ Object
Returns the value of attribute autopost.
-
#body ⇒ Object
Returns the value of attribute body.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#date ⇒ Object
Returns the value of attribute date.
-
#media ⇒ Object
Returns the value of attribute media.
-
#post_id ⇒ Object
Returns the value of attribute post_id.
-
#private ⇒ Object
Returns the value of attribute private.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
-
#source ⇒ Object
Returns the value of attribute source.
-
#sourceLink ⇒ Object
Returns the value of attribute sourceLink.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Post
constructor
A new instance of Post.
- #is_new? ⇒ Boolean
- #save ⇒ Object
Methods inherited from Base
client, establish_client, #getsites, #gettags, #newcomment, #newpost, #readposts, #updatepost
Constructor Details
#initialize(attributes = {}) ⇒ Post
Returns a new instance of Post.
6 7 8 |
# File 'lib/preposterous/post.rb', line 6 def initialize(attributes={}) @media = [] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/preposterous/post.rb', line 3 def attributes @attributes end |
#autopost ⇒ Object
Returns the value of attribute autopost.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def autopost @autopost end |
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def body @body end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/preposterous/post.rb', line 3 def client @client end |
#date ⇒ Object
Returns the value of attribute date.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def date @date end |
#media ⇒ Object
Returns the value of attribute media.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def media @media end |
#post_id ⇒ Object
Returns the value of attribute post_id.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def post_id @post_id end |
#private ⇒ Object
Returns the value of attribute private.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def private @private end |
#site_id ⇒ Object
Returns the value of attribute site_id.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def site_id @site_id end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def source @source end |
#sourceLink ⇒ Object
Returns the value of attribute sourceLink.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def sourceLink @sourceLink end |
#tags ⇒ Object
Returns the value of attribute tags.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/preposterous/post.rb', line 4 def title @title end |
Instance Method Details
#is_new? ⇒ Boolean
21 22 23 |
# File 'lib/preposterous/post.rb', line 21 def is_new? post_id.nil? end |
#save ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/preposterous/post.rb', line 25 def save if self.is_new? Preposterous::Base.client.newpost(attributes, *@media) else Preposterous::Base.client.updatepost(attributes, *@media) end end |