lib/facebooker/session.rb in facebooker-1.0.52 vs lib/facebooker/session.rb in facebooker-1.0.53
- old
+ new
@@ -217,16 +217,20 @@
user.session = self
user.populate_from_hash!(hash)
user
when 'photo'
Photo.from_hash(hash)
+ when 'album'
+ Album.from_hash(hash)
when 'page'
Page.from_hash(hash)
when 'page_admin'
Page.from_hash(hash)
when 'group'
Group.from_hash(hash)
+ when 'event'
+ Event.from_hash(hash)
when 'event_member'
Event::Attendance.from_hash(hash)
else
hash
end
@@ -271,11 +275,12 @@
# :eids => Filter by this list of event ids. This is a comma-separated list of eids.
# :start_time => Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound. (Time or Integer)
# :end_time => Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound. (Time or Integer)
# :rsvp_status => Filter by this RSVP status.
def events(options = {})
- @events ||= post('facebook.events.get', options) do |response|
+ @events ||= {}
+ @events[options.to_s] ||= post('facebook.events.get', options) do |response|
response.map do |hash|
Event.from_hash(hash)
end
end
end
@@ -296,11 +301,12 @@
result = post('facebook.events.cancel', options.merge(:eid => eid))
result == '1' ? true : false
end
def event_members(eid)
- @members ||= post('facebook.events.getMembers', :eid => eid) do |response|
+ @members ||= {}
+ @members[eid] ||= post('facebook.events.getMembers', :eid => eid) do |response|
response.map do |attendee_hash|
Event::Attendance.from_hash(attendee_hash)
end
end
end
@@ -347,9 +353,13 @@
Facebooker::Data.new(self)
end
def admin
Facebooker::Admin.new(self)
+ end
+
+ def application
+ Facebooker::Application.new(self)
end
def mobile
Facebooker::Mobile.new(self)
end