mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
events
This commit is contained in:
parent
a5265ad0d3
commit
0349beb157
3 changed files with 29 additions and 0 deletions
13
lib/fb_graph2/edge/events.rb
Normal file
13
lib/fb_graph2/edge/events.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module FbGraph2
|
||||
class Edge
|
||||
module Events
|
||||
def events(*args)
|
||||
params = args.extract_options!
|
||||
events = self.edge :events, params, edge_scope: args.first
|
||||
events.collect do |event|
|
||||
Event.new(event[:id], event).authenticate self.access_token
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
15
lib/fb_graph2/event.rb
Normal file
15
lib/fb_graph2/event.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module FbGraph2
|
||||
class Event < Node
|
||||
register_attributes(
|
||||
raw: [:description, :is_date_only, :location, :name, :privacy, :ticket_uri, :timezone],
|
||||
time: [:end_time, :start_time, :updated_time],
|
||||
page: [:venue],
|
||||
custom: [:cover, :owner, :parent_group]
|
||||
)
|
||||
|
||||
def initialize(id, attributes = {})
|
||||
super
|
||||
# TODO: handle custom attributes.
|
||||
end
|
||||
end
|
||||
end
|
|
@ -5,6 +5,7 @@ module FbGraph2
|
|||
include Edge::Activities
|
||||
include Edge::Albums
|
||||
include Edge::Books
|
||||
include Edge::Events
|
||||
include Edge::Feed
|
||||
include Edge::Friends
|
||||
include Edge::Games
|
||||
|
|
Loading…
Reference in a new issue