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.4.20 lib/fb_graph/comment.rb
fb_graph-2.4.19 lib/fb_graph/comment.rb
fb_graph-2.4.18 lib/fb_graph/comment.rb
fb_graph-2.4.17 lib/fb_graph/comment.rb
fb_graph-2.4.16 lib/fb_graph/comment.rb
fb_graph-2.4.15 lib/fb_graph/comment.rb
fb_graph-2.4.14 lib/fb_graph/comment.rb
fb_graph-2.4.13 lib/fb_graph/comment.rb
fb_graph-2.4.12 lib/fb_graph/comment.rb
fb_graph-2.4.11 lib/fb_graph/comment.rb
fb_graph-2.4.10 lib/fb_graph/comment.rb
fb_graph-2.4.9 lib/fb_graph/comment.rb
fb_graph-2.4.8 lib/fb_graph/comment.rb
fb_graph-2.4.7 lib/fb_graph/comment.rb
fb_graph-2.4.6 lib/fb_graph/comment.rb
fb_graph-2.4.4 lib/fb_graph/comment.rb
fb_graph-2.4.3 lib/fb_graph/comment.rb
fb_graph-2.4.2 lib/fb_graph/comment.rb
fb_graph-2.4.1 lib/fb_graph/comment.rb
fb_graph-2.4.0 lib/fb_graph/comment.rb