Class: FacebookEvents

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook_events.rb,
lib/facebook_events/version.rb

Constant Summary collapse

VERSION =
"0.0.3"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(facebook_id) ⇒ FacebookEvents

Returns a new instance of FacebookEvents.



8
9
10
11
# File 'lib/facebook_events.rb', line 8

def initialize(facebook_id)
  @facebook_id = facebook_id
  @auth_token  = get_auth_token
end

Instance Attribute Details

#facebook_idObject (readonly)

Returns the value of attribute facebook_id.



6
7
8
# File 'lib/facebook_events.rb', line 6

def facebook_id
  @facebook_id
end

Class Method Details

.list(facebook_id) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/facebook_events.rb', line 13

def self.list(facebook_id)
  facebook_resource = new(facebook_id)
  events = []
  event_list = facebook_resource.get_events_list(facebook_id)
  event_list.each do |event|
    events << facebook_resource.get_event_details(event.id)
  end
  events
end

Instance Method Details

#get_event_details(facebook_id) ⇒ Object



27
28
29
# File 'lib/facebook_events.rb', line 27

def get_event_details(facebook_id)
  MiniFB.get(@auth_token, facebook_id).to_hash
end

#get_events_list(facebook_id) ⇒ Object



23
24
25
# File 'lib/facebook_events.rb', line 23

def get_events_list(facebook_id)
  MiniFB.get(@auth_token, @facebook_id, :type => 'events').data
end