Sha256: ec04f7a0db77432d97073d4c11d7e4d4bae097bd5bf196843d87c4a36a07cd26

Contents?: true

Size: 867 Bytes

Versions: 42

Compression:

Stored size: 867 Bytes

Contents

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

    attr_accessor :from, :subject, :message, :created_time, :updated_time, :icon

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

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

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
fb_graph-1.8.0 lib/fb_graph/note.rb
fb_graph-1.8.0.alpha2 lib/fb_graph/note.rb
fb_graph-1.7.5 lib/fb_graph/note.rb
fb_graph-1.8.0.alpha lib/fb_graph/note.rb
fb_graph-1.7.4 lib/fb_graph/note.rb
fb_graph-1.7.3 lib/fb_graph/note.rb
fb_graph-1.7.2 lib/fb_graph/note.rb
fb_graph-1.7.1 lib/fb_graph/note.rb
fb_graph-1.7.0 lib/fb_graph/note.rb
fb_graph-1.7.0.alpha2 lib/fb_graph/note.rb
fb_graph-1.6.9 lib/fb_graph/note.rb
fb_graph-1.7.0.alpha lib/fb_graph/note.rb
fb_graph-1.6.8 lib/fb_graph/note.rb
fb_graph-1.6.7 lib/fb_graph/note.rb
fb_graph-1.6.5 lib/fb_graph/note.rb
fb_graph-1.6.4 lib/fb_graph/note.rb
fb_graph-1.6.3 lib/fb_graph/note.rb
fb_graph-1.6.2 lib/fb_graph/note.rb
fb_graph-1.6.1 lib/fb_graph/note.rb
fb_graph-1.6.0 lib/fb_graph/note.rb