Module: Capitan::ObjectInitializer
- Included in:
- Calendar::CalendarShow, Exhibition, NonTicketedEvent, Performance, Production, Venue
- Defined in:
- lib/capitan/object_initializer.rb
Instance Method Summary collapse
Instance Method Details
#initialize(hash = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/capitan/object_initializer.rb', line 3 def initialize(hash = {}) @errors = [] hash.each do |key, value| begin send("#{key}=", value) # If something passed in the API isn't defined for our model, log it and move on. rescue NoMethodError => error next end end end |