Sha256: d9ed2b16e404a1dc45da7bc1db9923f6bae6676fdcdd9a2ab8412131e94a1d9f

Contents?: true

Size: 698 Bytes

Versions: 34

Compression:

Stored size: 698 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]
          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

34 entries across 34 versions & 1 rubygems

Version Path
fb_graph-2.0.0.beta lib/fb_graph/status.rb
fb_graph-2.0.0.alpha lib/fb_graph/status.rb
fb_graph-1.9.5 lib/fb_graph/status.rb
fb_graph-1.9.4 lib/fb_graph/status.rb
fb_graph-1.9.3 lib/fb_graph/status.rb
fb_graph-1.9.2 lib/fb_graph/status.rb
fb_graph-1.9.1 lib/fb_graph/status.rb
fb_graph-1.9.0 lib/fb_graph/status.rb
fb_graph-1.8.6 lib/fb_graph/status.rb
fb_graph-1.8.5 lib/fb_graph/status.rb
fb_graph-1.8.4 lib/fb_graph/status.rb
fb_graph-1.8.3 lib/fb_graph/status.rb
fb_graph-1.8.2 lib/fb_graph/status.rb
fb_graph-1.8.1 lib/fb_graph/status.rb