Sha256: d99480eb5542af15ac15f9235ba0210b3cf7b9f56e49d9949c5de67181fded9c

Contents?: true

Size: 755 Bytes

Versions: 32

Compression:

Stored size: 755 Bytes

Contents

module FbGraph
  class Message < Node
    # TODO:
    # include Connections::Attachments
    # include Connections::Shares
    include Connections::Tags

    attr_accessor :message, :from, :to, :created_time

    def initialize(identifier, attributes = {})
      super
      @message = attributes[:message]
      if (from = attributes[:from])
        @from = User.new(from[:id], from)
      end
      @to = []
      if attributes[:to]
        Collection.new(attributes[:to]).each do |to|
          @to << User.new(to[:id], to)
        end
      end
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end

      # cached connection
      @_tags_ = Collection.new(attributes[:tags])
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fb_graph-2.2.2 lib/fb_graph/message.rb
fb_graph-2.2.1 lib/fb_graph/message.rb
fb_graph-2.2.0 lib/fb_graph/message.rb
fb_graph-2.2.0.beta lib/fb_graph/message.rb
fb_graph-2.2.0.alpha2 lib/fb_graph/message.rb
fb_graph-2.2.0.alpha lib/fb_graph/message.rb
fb_graph-2.1.13 lib/fb_graph/message.rb
fb_graph-2.1.12 lib/fb_graph/message.rb
fb_graph-2.1.11 lib/fb_graph/message.rb
fb_graph-2.1.10 lib/fb_graph/message.rb
fb_graph-2.1.9 lib/fb_graph/message.rb
fb_graph-2.1.8 lib/fb_graph/message.rb
fb_graph-2.1.7 lib/fb_graph/message.rb
fb_graph-2.1.6 lib/fb_graph/message.rb
fb_graph-2.1.5 lib/fb_graph/message.rb
fb_graph-2.1.4 lib/fb_graph/message.rb
fb_graph-2.1.3 lib/fb_graph/message.rb
fb_graph-2.1.2 lib/fb_graph/message.rb
fb_graph-2.1.1 lib/fb_graph/message.rb
fb_graph-2.1.0 lib/fb_graph/message.rb