Class: FbGraph::Post
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#attribution ⇒ Object
Returns the value of attribute attribution.
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#description ⇒ Object
Returns the value of attribute description.
-
#from ⇒ Object
Returns the value of attribute from.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#likes ⇒ Object
Returns the value of attribute likes.
-
#link ⇒ Object
Returns the value of attribute link.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#picture ⇒ Object
Returns the value of attribute picture.
-
#source ⇒ Object
Returns the value of attribute source.
-
#to ⇒ Object
Returns the value of attribute to.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, options = {}) ⇒ Post
constructor
A new instance of Post.
Methods included from Searchable
Methods included from Connections::Comments
#comment!, #comments, #like!, #unlike!
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, options = {}) ⇒ Post
Returns a new instance of Post.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fb_graph/post.rb', line 8 def initialize(identifier, = {}) super if (from = [:from]) @from = if from[:category] FbGraph::Page.new(from.delete(:id), from) else FbGraph::User.new(from.delete(:id), from) end end @to = [] if [:to] FbGraph::Collection.new([:to]).each do |to| @to << if to[:category] FbGraph::Page.new(to.delete(:id), to) else FbGraph::User.new(to.delete(:id), to) end end end @message = [:message] @picture = [:picture] @link = [:link] @name = [:name] @caption = [:caption] @description = [:description] @source = [:source] @icon = [:icon] @attribution = [:attribution] @actions = [:actions] @likes = [:likes] if [:created_time] @created_time = Time.parse([:created_time]).utc end if [:updated_time] @updated_time = Time.parse([:updated_time]).utc end # cached connection @_comments_ = FbGraph::Collection.new([:comments]) end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def actions @actions end |
#attribution ⇒ Object
Returns the value of attribute attribution.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def attribution @attribution end |
#caption ⇒ Object
Returns the value of attribute caption.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def @caption end |
#created_time ⇒ Object
Returns the value of attribute created_time.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def description @description end |
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def from @from end |
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def icon @icon end |
#likes ⇒ Object
Returns the value of attribute likes.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def likes @likes end |
#link ⇒ Object
Returns the value of attribute link.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def link @link end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def @message end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def name @name end |
#picture ⇒ Object
Returns the value of attribute picture.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def picture @picture end |
#source ⇒ Object
Returns the value of attribute source.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def source @source end |
#to ⇒ Object
Returns the value of attribute to.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def to @to end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
6 7 8 |
# File 'lib/fb_graph/post.rb', line 6 def updated_time @updated_time end |