Class: FbGraph2::Post

Inherits:
Node
  • Object
show all
Includes:
Edge::Comments, Edge::Insights, Edge::Likes::LikeeContext, Edge::SharedPosts
Defined in:
lib/fb_graph2/post.rb

Instance Attribute Summary

Attributes inherited from Node

#access_token, #id

Instance Method Summary collapse

Methods included from Edge::SharedPosts

#shared_posts

Methods included from Edge::Likes::LikeeContext

#assign, #like!, #likes, #unlike!

Methods included from Edge::Insights

#insights

Methods included from Edge::Comments

#assign, #comment!, #comments

Methods inherited from Node

#authenticate, #destroy, #edge, #edges, #fetch, #update

Methods included from AttributeAssigner

#assign

Constructor Details

#initialize(id, attributes = {}) ⇒ Post

Returns a new instance of Post.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fb_graph2/post.rb', line 24

def initialize(id, attributes = {})
  super
  if attributes.include? :message_tags
    self.message_tags = attributes[:message_tags].collect do |message_tag|
      TaggedProfile.new message_tag[:id], message_tag
    end
  end
  if attributes.include? :privacy
    self.privacy = Struct::Privacy.new attributes[:privacy]
  end
  if attributes.include? :properties
    self.properties = attributes[:properties].collect do |property|
      Struct::Property.new property
    end
  end
  if attributes.include? :shares
    self.shares = Struct::Share.new attributes[:shares]
  end
end