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.8.0 lib/fb_graph/comment.rb
fb_graph-1.8.0.alpha2 lib/fb_graph/comment.rb
fb_graph-1.7.5 lib/fb_graph/comment.rb
fb_graph-1.8.0.alpha lib/fb_graph/comment.rb
fb_graph-1.7.4 lib/fb_graph/comment.rb
fb_graph-1.7.3 lib/fb_graph/comment.rb
fb_graph-1.7.2 lib/fb_graph/comment.rb
fb_graph-1.7.1 lib/fb_graph/comment.rb
fb_graph-1.7.0 lib/fb_graph/comment.rb
fb_graph-1.7.0.alpha2 lib/fb_graph/comment.rb
fb_graph-1.6.9 lib/fb_graph/comment.rb
fb_graph-1.7.0.alpha lib/fb_graph/comment.rb
fb_graph-1.6.8 lib/fb_graph/comment.rb
fb_graph-1.6.7 lib/fb_graph/comment.rb
fb_graph-1.6.5 lib/fb_graph/comment.rb
fb_graph-1.6.4 lib/fb_graph/comment.rb
fb_graph-1.6.3 lib/fb_graph/comment.rb
fb_graph-1.6.2 lib/fb_graph/comment.rb
fb_graph-1.6.1 lib/fb_graph/comment.rb
fb_graph-1.6.0 lib/fb_graph/comment.rb