Class: Eventick::Checkin
Instance Attribute Summary collapse
-
#attendee ⇒ Object
Returns the value of attribute attendee.
-
#checkin_time ⇒ Object
Returns the value of attribute checkin_time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Checkin
constructor
A new instance of Checkin.
- #save ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(args = {}) ⇒ Checkin
Returns a new instance of Checkin.
7 8 9 10 |
# File 'lib/eventick/checkin.rb', line 7 def initialize(args={}) self.attendee = args[:attendee] self.checkin_time = Time.now end |
Instance Attribute Details
#attendee ⇒ Object
Returns the value of attribute attendee.
5 6 7 |
# File 'lib/eventick/checkin.rb', line 5 def attendee @attendee end |
#checkin_time ⇒ Object
Returns the value of attribute checkin_time.
5 6 7 |
# File 'lib/eventick/checkin.rb', line 5 def checkin_time @checkin_time end |
Class Method Details
.all(event, attendees) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/eventick/checkin.rb', line 16 def self.all(event,attendees) params = params(event) checkin_time = Time.now attendees.each{ |a| a.checkin_at = checkin_time } atts = attendees.map{ |a| a.to_json }.join(",") data = "{ 'attendees': [#{ atts }] }" checkin_response = Eventick.put path(params), data true end |
.create(attendee) ⇒ Object
12 13 14 |
# File 'lib/eventick/checkin.rb', line 12 def self.create(attendee) (self.new :attendee => attendee).save end |