Sha256: 8ae905251c47c5a0d50e81d795cd34a84795589c69221dc272a0820135bf8c5a

Contents?: true

Size: 1.03 KB

Versions: 14

Compression:

Stored size: 1.03 KB

Contents

module Centaman
  #:nodoc:
  class Service::CreateCustomer < Centaman::Service
    include Centaman::JsonWrapper
    attr_reader :first_name, :last_name, :email, :phone

    def after_init(args)
      @first_name = args[:first_name]
      @last_name = args[:last_name]
      @email = args[:email]
      @phone = args[:phone]
    end

    def endpoint
      '/ticket_services/TimedTicket'
    end

    def object_class
      Centaman::Object::Customer
    end

    # rubocop:disable Metrics/MethodLength
    def address
      {
        'Street1' => '',
        'Street2' => '',
        'City' => '',
        'State' => '',
        'Postalcode' => '',
        'Country' => '',
        'HomePhone' => phone || '',
        'WorkPhone' => '',
        'MobilePhone' => ''
      }
    end
    # rubocop:enable Metrics/MethodLength

    # rubocop:disable Metrics/MethodLength
    def options_hash
      {
        'FirstName' => first_name,
        'LastName' => last_name,
        'Email' => email,
        'Address' => address
      }.to_json
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
centaman-6.0.8 lib/centaman/service/create_customer.rb
centaman-6.0.7 lib/centaman/service/create_customer.rb
centaman-6.0.5 lib/centaman/service/create_customer.rb
centaman-6.0.4 lib/centaman/service/create_customer.rb
centaman-6.0.3 lib/centaman/service/create_customer.rb
centaman-6.0.2 lib/centaman/service/create_customer.rb
centaman-6.0.1 lib/centaman/service/create_customer.rb
centaman-6.0.0 lib/centaman/service/create_customer.rb
centaman-5.0.8 lib/centaman/service/create_customer.rb
centaman-5.0.7 lib/centaman/service/create_customer.rb
centaman-5.0.6 lib/centaman/service/create_customer.rb
centaman-5.0.5 lib/centaman/service/create_customer.rb
centaman-5.0.4 lib/centaman/service/create_customer.rb
centaman-5.0.3 lib/centaman/service/create_customer.rb