Class: Centaman::Object
- Inherits:
-
Object
- Object
- Centaman::Object
- Defined in:
- lib/centaman/object.rb
Overview
:nodoc:
Direct Known Subclasses
AddOn, AttendeeDetail, BookingTime, BookingType, Capacity, CostRate, CouponCheck, Customer, Effect, Extra, GeneralAdmissionTicket, GiftTicket, Member, MembershipType, PurchasedGeneralAdmissionTicket, PurchasedTicket, TicketType, Udf
Defined Under Namespace
Classes: AddOn, AttendeeDetail, BookingTime, BookingType, Capacity, CostRate, CouponCheck, Customer, Effect, Extra, GeneralAdmissionTicket, GiftTicket, Member, MembershipType, PurchasedGeneralAdmissionTicket, PurchasedTicket, PurchasedTimedTicket, TicketType, Udf
Instance Method Summary collapse
- #after_init(args) ⇒ Object
- #attributes ⇒ Object
- #define_variables(args) ⇒ Object
-
#initialize(args = {}) ⇒ Object
constructor
A new instance of Object.
Constructor Details
#initialize(args = {}) ⇒ Object
Returns a new instance of Object.
4 5 6 7 |
# File 'lib/centaman/object.rb', line 4 def initialize(args = {}) define_variables(args) after_init(args) end |
Instance Method Details
#after_init(args) ⇒ Object
23 24 25 |
# File 'lib/centaman/object.rb', line 23 def after_init(args) # hook for subclasses end |
#attributes ⇒ Object
19 20 21 |
# File 'lib/centaman/object.rb', line 19 def attributes [] # overwritten by subclasses end |
#define_variables(args) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/centaman/object.rb', line 9 def define_variables(args) attributes.each do |attribute| val = args[attribute.centaman_key] attribute.value = val attribute.parse_value self.class.__send__(:attr_accessor, attribute.app_key) instance_variable_set("@#{attribute.app_key}", attribute.value) end end |