Class: FbGraph::Event

Inherits:
Node
  • Object
show all
Extended by:
Searchable
Includes:
Connections::Attending, Connections::Declined, Connections::Feed, Connections::Invited, Connections::Maybe, Connections::Noreply, Connections::Picture, Connections::Videos
Defined in:
lib/fb_graph/event.rb

Instance Attribute Summary (collapse)

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary (collapse)

Methods included from Searchable

search, search, search_query_param

Methods included from Connections::Videos

#video!, #videos

Methods included from Connections::Picture

#picture

Methods included from Connections::Declined

#declined, #declined!, #declined?

Methods included from Connections::Attending

#attend!, #attending, #attending?

Methods included from Connections::Invited

#invite!, #invited, #invited?, #uninvite!

Methods included from Connections::Maybe

#maybe, #maybe!, #maybe?

Methods included from Connections::Noreply

#noreply, #noreply?

Methods included from Connections::Feed

#feed, #feed!

Methods inherited from Node

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

Methods included from Comparison

#==

Constructor Details

- (Event) initialize(identifier, attributes = {})

Returns a new instance of Event



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
46
47
48
49
50
51
# File 'lib/fb_graph/event.rb', line 15

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 Integer
      Time.at(start_time)
    end
  end
  if (end_time = attributes[:end_time])
    @end_time = case end_time
    when String
      Time.parse(end_time)
    when Integer
      Time.at(end_time)
    end
  end
  if (venue = attributes[:venue]).present?
    @venue = if venue[:id]
      Page.new(venue[:id], venue)
    else
      Venue.new(venue)
    end
  end
  if attributes[:updated_time]
    @updated_time = Time.parse(attributes[:updated_time]).utc
  end
  @ticket_uri = attributes[:ticket_uri]
end

Instance Attribute Details

- (Object) description

Returns the value of attribute description



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

def description
  @description
end

- (Object) end_time

Returns the value of attribute end_time



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

def end_time
  @end_time
end

- (Object) location

Returns the value of attribute location



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

def location
  @location
end

- (Object) name

Returns the value of attribute name



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

def name
  @name
end

- (Object) owner

Returns the value of attribute owner



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

def owner
  @owner
end

- (Object) privacy

Returns the value of attribute privacy



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

def privacy
  @privacy
end

- (Object) start_time

Returns the value of attribute start_time



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

def start_time
  @start_time
end

- (Object) ticket_uri

Returns the value of attribute ticket_uri



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

def ticket_uri
  @ticket_uri
end

- (Object) updated_time

Returns the value of attribute updated_time



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

def updated_time
  @updated_time
end

- (Object) venue

Returns the value of attribute venue



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

def venue
  @venue
end