Sha256: 0ec0f0ffc6fee763916572cb694d3d73eff96754e20f3c1474e0b7d59b357109

Contents?: true

Size: 853 Bytes

Versions: 34

Compression:

Stored size: 853 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[:id], from)
        else
          User.new(from[: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

34 entries across 34 versions & 1 rubygems

Version Path
fb_graph-2.2.0.alpha2 lib/fb_graph/note.rb
fb_graph-2.2.0.alpha lib/fb_graph/note.rb
fb_graph-2.1.13 lib/fb_graph/note.rb
fb_graph-2.1.12 lib/fb_graph/note.rb
fb_graph-2.1.11 lib/fb_graph/note.rb
fb_graph-2.1.10 lib/fb_graph/note.rb
fb_graph-2.1.9 lib/fb_graph/note.rb
fb_graph-2.1.8 lib/fb_graph/note.rb
fb_graph-2.1.7 lib/fb_graph/note.rb
fb_graph-2.1.6 lib/fb_graph/note.rb
fb_graph-2.1.5 lib/fb_graph/note.rb
fb_graph-2.1.4 lib/fb_graph/note.rb
fb_graph-2.1.3 lib/fb_graph/note.rb
fb_graph-2.1.2 lib/fb_graph/note.rb
fb_graph-2.1.1 lib/fb_graph/note.rb
fb_graph-2.1.0 lib/fb_graph/note.rb
fb_graph-2.1.0.alpha lib/fb_graph/note.rb
fb_graph-2.0.2 lib/fb_graph/note.rb
fb_graph-2.0.1 lib/fb_graph/note.rb
fb_graph-2.0.0 lib/fb_graph/note.rb