class Eventioz::Registration

Represents an Eventioz Registration.

Attributes

accreditation_code[RW]
amount[RW]
attended[RW]
cancelled_at[RW]
created_at[RW]
due_date[RW]
email[RW]
first_name[RW]
last_name[RW]
purchased_at[RW]
random_code[RW]
second_amount[RW]
second_due_date[RW]

Public Class Methods

all(api_key, event_slug) click to toggle source

Calls the Eventioz API to retrieve all tickets purchased to a specific event.

# File lib/eventioz/registration.rb, line 14
def self.all(api_key, event_slug)
    result = []

    json = JSON.parse RestClient.get("#{BASE_URL}admin/events/#{event_slug}/registrations.json?api_key=#{api_key}")
    json.each do |reg|
      r = Eventioz::Registration.new({})
      reg['registration'].each do |key, value|
        r.send("#{key}=", value)
      end
      result << r
    end

    result
end
new(h = {}) click to toggle source
# File lib/eventioz/registration.rb, line 9
def initialize(h = {})
  h.each { |key, value| send("#{key}=", value) }
end