Class: SimpleEventickApi::Attendee
- Defined in:
- lib/simple_eventick_api/attendee.rb
Instance Attribute Summary collapse
-
#checked_at ⇒ Object
Returns the value of attribute checked_at.
-
#code ⇒ Object
Returns the value of attribute code.
-
#email ⇒ Object
Returns the value of attribute email.
-
#event_id ⇒ Object
Returns the value of attribute event_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ticket_type ⇒ Object
Returns the value of attribute ticket_type.
Class Method Summary collapse
-
.all(token, event_id, checked_at = nil) ⇒ Object
class methods.
- .check_in(token, event_id, code, checked_at) ⇒ Object
- .find(token, event_id, id) ⇒ Object
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Attendee
constructor
A new instance of Attendee.
Methods inherited from Base
Constructor Details
#initialize(args = {}) ⇒ Attendee
Returns a new instance of Attendee.
10 11 12 13 14 |
# File 'lib/simple_eventick_api/attendee.rb', line 10 def initialize(args={}) args.each do |key, value| self.public_send("#{key}=", value) end end |
Instance Attribute Details
#checked_at ⇒ Object
Returns the value of attribute checked_at.
8 9 10 |
# File 'lib/simple_eventick_api/attendee.rb', line 8 def checked_at @checked_at end |
#code ⇒ Object
Returns the value of attribute code.
8 9 10 |
# File 'lib/simple_eventick_api/attendee.rb', line 8 def code @code end |
#email ⇒ Object
Returns the value of attribute email.
8 9 10 |
# File 'lib/simple_eventick_api/attendee.rb', line 8 def email @email end |
#event_id ⇒ Object
Returns the value of attribute event_id.
8 9 10 |
# File 'lib/simple_eventick_api/attendee.rb', line 8 def event_id @event_id end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/simple_eventick_api/attendee.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/simple_eventick_api/attendee.rb', line 7 def name @name end |
#ticket_type ⇒ Object
Returns the value of attribute ticket_type.
8 9 10 |
# File 'lib/simple_eventick_api/attendee.rb', line 8 def ticket_type @ticket_type end |
Class Method Details
.all(token, event_id, checked_at = nil) ⇒ Object
class methods
17 18 19 20 21 22 23 24 |
# File 'lib/simple_eventick_api/attendee.rb', line 17 def self.all(token, event_id, checked_at = nil) resource "events/#{event_id}/attendees" response = get(token, {checked_at: checked_at}) attendees = response['attendees'].map { |json| self.new json } attendees.each { |a| a.event_id = event_id } end |
.check_in(token, event_id, code, checked_at) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/simple_eventick_api/attendee.rb', line 35 def self.check_in(token, event_id, code, checked_at ) resource "events/#{event_id}/attendees/#{code}" response = get(token, {checked_at: checked_at}) attendees = response['attendees'].map { |json| self.new json } attendees.each { |a| a.event_id = event_id }.first end |
.find(token, event_id, id) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/simple_eventick_api/attendee.rb', line 26 def self.find(token, event_id, id ) resource "events/#{event_id}/attendees/#{id}" response = get(token) attendees = response['attendees'].map { |json| self.new json } attendees.each { |a| a.event_id = event_id }.first end |