Module: GSGraph::Connections::Invited
- Included in:
- Event
- Defined in:
- lib/gs_graph/connections/invited.rb
Instance Method Summary collapse
- #invite!(*users) ⇒ Object
- #invited(options = {}) ⇒ Object
- #invited?(user, options = {}) ⇒ Boolean
- #uninvite!(user, options = {}) ⇒ Object
Instance Method Details
#invite!(*users) ⇒ Object
25 26 27 28 29 |
# File 'lib/gs_graph/connections/invited.rb', line 25 def invite!(*users) = users. [:users] ||= Array(users).flatten.collect(&:identifier).join(',') post .merge(:connection => :invited) end |
#invited(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/gs_graph/connections/invited.rb', line 4 def invited( = {}) members = self.connection :invited, members.map! do |member| User.new member[:id], member.merge( :access_token => [:access_token] || self.access_token ) end end |
#invited?(user, options = {}) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gs_graph/connections/invited.rb', line 13 def invited?(user, = {}) member = self.connection( :invited, .merge(:connection_scope => user.identifier) ).first member.present? && User.new( member[:id], member.merge( :access_token => [:access_token] || self.access_token ) ).rsvp_status.to_sym end |
#uninvite!(user, options = {}) ⇒ Object
31 32 33 |
# File 'lib/gs_graph/connections/invited.rb', line 31 def uninvite!(user, ={}) delete .merge(:connection => :invited, :connection_scope => user.identifier) end |