Sha256: b4ea7c0a71163b67b16ef13cd8ddd5b09de61f667451614523b423ea433a62d4

Contents?: true

Size: 590 Bytes

Versions: 42

Compression:

Stored size: 590 Bytes

Contents

module FbGraph
  class Comment < Node
    include Connections::Likes

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

    def initialize(identifier, attributes = {})
      super
      if (from = attributes[:from])
        @from = if from[:category]
          Page.new(from.delete(:id), from)
        else
          User.new(from.delete(: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

42 entries across 42 versions & 1 rubygems

Version Path
fb_graph-1.5.5 lib/fb_graph/comment.rb
fb_graph-1.5.4 lib/fb_graph/comment.rb
fb_graph-1.5.3 lib/fb_graph/comment.rb
fb_graph-1.5.2 lib/fb_graph/comment.rb
fb_graph-1.5.1 lib/fb_graph/comment.rb
fb_graph-1.5.0 lib/fb_graph/comment.rb
fb_graph-1.4.1 lib/fb_graph/comment.rb
fb_graph-1.4.0 lib/fb_graph/comment.rb
fb_graph-1.3.9 lib/fb_graph/comment.rb
fb_graph-1.3.8 lib/fb_graph/comment.rb
fb_graph-1.3.7 lib/fb_graph/comment.rb
fb_graph-1.3.6 lib/fb_graph/comment.rb
fb_graph-1.3.5 lib/fb_graph/comment.rb
fb_graph-1.3.4 lib/fb_graph/comment.rb
fb_graph-1.3.3 lib/fb_graph/comment.rb
fb_graph-1.3.2 lib/fb_graph/comment.rb
fb_graph-1.3.1 lib/fb_graph/comment.rb
fb_graph-1.3.0 lib/fb_graph/comment.rb
fb_graph-1.2.5 lib/fb_graph/comment.rb
fb_graph-1.2.4 lib/fb_graph/comment.rb