class Eventioz::Event
Attributes
api_key[RW]
cached_slug[RW]
created_at[RW]
end_date[RW]
name[RW]
registrations_count[RW]
start_date[RW]
status[RW]
time_zone[RW]
Public Class Methods
all(api_key, organizer_slug)
click to toggle source
Returns all events created by a specific organizer.
# File lib/eventioz/event.rb, line 13 def self.all(api_key, organizer_slug) result = [] json = JSON.parse RestClient.get("#{BASE_URL}admin/organizers/#{organizer_slug}/events.json?api_key=#{api_key}") json.each do |event| e = Eventioz::Event.new({}) event['event'].each do |key, value| e.send("#{key}=", value) end e.api_key = @api_key result << e end result end
new(h = {})
click to toggle source
# File lib/eventioz/event.rb, line 8 def initialize(h = {}) h.each { |key, value| send("#{key}=", value) } end