class Centaman::Object::Customer

Attributes

address[R]
attendees[R]
phone[R]

Public Instance Methods

after_init(args) click to toggle source

rubocop:disable Metrics/MethodLength

# File lib/centaman/object/customer.rb, line 6
def after_init(args)
  @address = args["Address"]
  @phone = args["Address"]["HomePhone"]
  @attendees = build_booking_attendees(args["BookingAttendee"])
end
attributes() click to toggle source
# File lib/centaman/object/customer.rb, line 16
def attributes
  [
    Centaman::Attribute.new(
      centaman_key: 'MemberCode',
      app_key: :member_code,
      type: :integer
    ),
    Centaman::Attribute.new(
      centaman_key: 'FirstName',
      app_key: :first_name,
      type: :string
    ),
    Centaman::Attribute.new(
      centaman_key: 'LastName',
      app_key: :last_name,
      type: :string
    ),
    Centaman::Attribute.new(
      centaman_key: 'Email',
      app_key: :email,
      type: :string
    ),
  ]
end
build_booking_attendees(booking_attendees = []) click to toggle source
# File lib/centaman/object/customer.rb, line 12
def build_booking_attendees(booking_attendees = [])
  booking_attendees.map { |a| Centaman::Object::AttendeeDetail.new(a) }
end