Class: FbGraph::Doc

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/doc.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ Doc

Returns a new instance of Doc.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fb_graph/doc.rb', line 5

def initialize(identifier, attributes = {})
  super
  @from = if attributes[:from]
    User.new(attributes[:from][:id], attributes[:from])
  end
  @subject = attributes[:subject]
  @icon = attributes[:icon]
  @revision = attributes[:revision]
  @updated_time = if attributes[:updated_time]
    Time.parse(attributes[:updated_time]).utc
  end
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/fb_graph/doc.rb', line 3

def from
  @from
end

#iconObject

Returns the value of attribute icon.



3
4
5
# File 'lib/fb_graph/doc.rb', line 3

def icon
  @icon
end

#revisionObject

Returns the value of attribute revision.



3
4
5
# File 'lib/fb_graph/doc.rb', line 3

def revision
  @revision
end

#subjectObject

Returns the value of attribute subject.



3
4
5
# File 'lib/fb_graph/doc.rb', line 3

def subject
  @subject
end

#updated_timeObject

Returns the value of attribute updated_time.



3
4
5
# File 'lib/fb_graph/doc.rb', line 3

def updated_time
  @updated_time
end