class Evvnt::Event

Public: Returns events info from the EVVNT API

Public Instance Methods

create() click to toggle source

POST /events Create an event

# File lib/evvnt/event.rb, line 15
define_action :create
index() click to toggle source

GET /events List Events

# File lib/evvnt/event.rb, line 7
define_action :index
mine() click to toggle source

GET /events/mine List my events

# File lib/evvnt/event.rb, line 27
define_action :mine
ours() click to toggle source

GET /events/ours(/:id) Get events of you and your created users

# File lib/evvnt/event.rb, line 23
define_action :ours
show() click to toggle source

GET /events/:event_id Get one event

# File lib/evvnt/event.rb, line 11
define_action :show
update() click to toggle source

PUT /events/:event_id Update an event

# File lib/evvnt/event.rb, line 19
define_action :update

Private Instance Methods

format_array_attribute(key, value) click to toggle source
# File lib/evvnt/event.rb, line 44
def format_array_attribute(key, value)
  case key
  when /^(image\_urls|sub\_category\_ids)$/
    send(:"format_#{key}_attribute", key, value)
  else
    super
  end
end
format_hash_attribute(key, value) click to toggle source
Calls superclass method Evvnt::Attributes#format_hash_attribute
# File lib/evvnt/event.rb, line 33
def format_hash_attribute(key, value)
  case key
  when "links"
    format_links_attribute(key, value)
  when "prices"
    format_prices_attribute(key, value)
  else
    super
  end
end
format_image_urls_attribute(_key, value) click to toggle source
# File lib/evvnt/event.rb, line 53
def format_image_urls_attribute(_key, value)
  value
end
format_prices_attribute(_key, value) click to toggle source
# File lib/evvnt/event.rb, line 65
def format_prices_attribute(_key, value)
  value.to_a.map { |name, price| Evvnt::Price.new(name: name, value: price) }
end
format_sub_category_ids_attribute(_key, value) click to toggle source
# File lib/evvnt/event.rb, line 57
def format_sub_category_ids_attribute(_key, value)
  value
end