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.3.2 lib/fb_graph/comment.rb
fb_graph-2.3.1 lib/fb_graph/comment.rb
fb_graph-2.3.0 lib/fb_graph/comment.rb
fb_graph-2.2.6 lib/fb_graph/comment.rb
fb_graph-2.2.5 lib/fb_graph/comment.rb
fb_graph-2.2.4 lib/fb_graph/comment.rb
fb_graph-2.2.3 lib/fb_graph/comment.rb
fb_graph-2.2.2 lib/fb_graph/comment.rb
fb_graph-2.2.1 lib/fb_graph/comment.rb
fb_graph-2.2.0 lib/fb_graph/comment.rb
fb_graph-2.2.0.beta lib/fb_graph/comment.rb