Sha256: c6179d069833e5dd5b90538d2fb73a06fda52ae7d7f25d78be1b0ad1ce6ffc06

Contents?: true

Size: 755 Bytes

Versions: 5

Compression:

Stored size: 755 Bytes

Contents

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

    attr_accessor :from, :message, :updated_time

    def initialize(identifier, attributes = {})
      super
      if (from = attributes[:from])
        @from = if from[:category]
          FbGraph::Page.new(from.delete(:id), from)
        else
          FbGraph::User.new(from.delete(:id), from)
        end
      end
      @message = attributes[:message]
      if (updated_time = attributes.delete(:updated_time))
        @updated_time = Time.parse(updated_time).utc
      end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fb_graph-1.2.1 lib/fb_graph/status.rb
fb_graph-1.2.0 lib/fb_graph/status.rb
fb_graph-1.1.7 lib/fb_graph/status.rb
fb_graph-1.1.6 lib/fb_graph/status.rb
fb_graph-1.1.5 lib/fb_graph/status.rb