Sha256: 9744e08f47ba3ad0a11464120f97ef93460c1786b329e232d8e007d52f157f53

Contents?: true

Size: 616 Bytes

Versions: 51

Compression:

Stored size: 616 Bytes

Contents

module FbGraph
  class Comment < Node
    include Connections::Likes
    include Connections::Likes::Likable

    attr_accessor :from, :message, :created_time, :like_count

    def initialize(identifier, attributes = {})
      super
      if (from = attributes[:from])
        @from = if from[:category]
          Page.new(from[:id], from)
        else
          User.new(from[:id], from)
        end
      end
      @message = attributes[:message]
      @like_count = attributes[:likes]
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
fb_graph-2.7.1 lib/fb_graph/comment.rb
fb_graph-2.7.0 lib/fb_graph/comment.rb
fb_graph-2.6.7 lib/fb_graph/comment.rb
fb_graph-2.6.6 lib/fb_graph/comment.rb
fb_graph-2.6.5 lib/fb_graph/comment.rb
fb_graph-2.6.4 lib/fb_graph/comment.rb
fb_graph-2.6.3 lib/fb_graph/comment.rb
fb_graph-2.6.2 lib/fb_graph/comment.rb
fb_graph-2.6.1 lib/fb_graph/comment.rb
fb_graph-2.6.0 lib/fb_graph/comment.rb
fb_graph-2.5.9 lib/fb_graph/comment.rb
fb_graph-2.5.8 lib/fb_graph/comment.rb
fb_graph-2.5.7 lib/fb_graph/comment.rb
fb_graph-2.5.6 lib/fb_graph/comment.rb
fb_graph-2.5.5 lib/fb_graph/comment.rb
fb_graph-2.5.4 lib/fb_graph/comment.rb
fb_graph-2.5.3 lib/fb_graph/comment.rb
fb_graph-2.5.2 lib/fb_graph/comment.rb
fb_graph-2.5.1 lib/fb_graph/comment.rb
fb_graph-2.5.0 lib/fb_graph/comment.rb