Class: FbGraph::Event

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods included from Searchable

search, search

Methods included from Connections::Picture

#picture

Methods included from Connections::Declined

#declined, #declined!

Methods included from Connections::Attending

#attending, #attending!

Methods included from Connections::Invited

#invited

Methods included from Connections::Maybe

#maybe, #maybe!

Methods included from Connections::Noreply

#noreply

Methods included from Connections::Feed

#feed, #feed!

Methods inherited from Node

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

Methods included from Comparison

#==

Constructor Details

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

Returns a new instance of Event.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fb_graph/event.rb', line 14

def initialize(identifier, attributes = {})
  super
  if (owner = attributes[:owner])
    @owner = User.new(owner[:id], owner)
  end
  @name        = attributes[:name]
  @description = attributes[:description]
  @location    = attributes[:location]
  @privacy     = attributes[:privacy]
  if (start_time = attributes[:start_time])
    @start_time = case start_time
    when String
      Time.parse(start_time)
    when Fixnum
      Time.at(start_time)
    end
  end
  if (end_time = attributes[:end_time])
    @end_time = case end_time
    when String
      Time.parse(end_time)
    when Fixnum
      Time.at(end_time)
    end
  end
  if attributes[:venue]
    @venue = Venue.new(attributes[:venue])
  end
  if attributes[:updated_time]
    @updated_time = Time.parse(attributes[:updated_time]).utc
  end
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def description
  @description
end

#end_timeObject

Returns the value of attribute end_time.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def end_time
  @end_time
end

#locationObject

Returns the value of attribute location.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def location
  @location
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def owner
  @owner
end

#privacyObject

Returns the value of attribute privacy.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def privacy
  @privacy
end

#start_timeObject

Returns the value of attribute start_time.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def start_time
  @start_time
end

#updated_timeObject

Returns the value of attribute updated_time.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def updated_time
  @updated_time
end

#venueObject

Returns the value of attribute venue.



12
13
14
# File 'lib/fb_graph/event.rb', line 12

def venue
  @venue
end