Sha256: e541e0bfda361205f00f30151c05434da1d77c273e859466701db9e8087fc541

Contents?: true

Size: 738 Bytes

Versions: 4

Compression:

Stored size: 738 Bytes

Contents

module FbGraph
  class Status < Node
    include Connections::Comments
    include Connections::Likes
    include Connections::Likes::Likable

    attr_accessor :from, :message, :updated_time

    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]
      if (updated_time = attributes[:updated_time])
        @updated_time = Time.parse(updated_time).utc
      end

      # cached connection
      @_comments_ = Collection.new(attributes[:comments])
      @_likes_ = Collection.new(attributes[:likes])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-2.2.2 lib/fb_graph/status.rb
fb_graph-2.2.1 lib/fb_graph/status.rb
fb_graph-2.2.0 lib/fb_graph/status.rb
fb_graph-2.2.0.beta lib/fb_graph/status.rb