Module: TicketMaster::Provider::Common::ClassMethods

Defined in:
lib/ticketmaster/common.rb

Instance Method Summary collapse

Instance Method Details

#create(*options) ⇒ Object

Create a something. Basically, a .new and .save in the same call. The default method assumes it is passed a single hash with attribute information



9
10
11
12
13
14
15
16
17
# File 'lib/ticketmaster/common.rb', line 9

def create(*options)
  if self::API.is_a? Class
    something = self::API.new(*options)
    something.save
    self.new something
  else
    raise TicketMaster::Exception.new("#{self.name}::#{this_method} method must be implemented by the provider")
  end
end