Sha256: 8d475c0408dcbe346bb2109130eea41e55b14d6d818029c812aa5bd2155f3829

Contents?: true

Size: 1.02 KB

Versions: 33

Compression:

Stored size: 1.02 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

33 entries across 33 versions & 1 rubygems

Version Path
centaman-5.0.2 lib/centaman/service/create_customer.rb
centaman-5.0.1 lib/centaman/service/create_customer.rb
centaman-5.0.0 lib/centaman/service/create_customer.rb
centaman-4.0.5 lib/centaman/service/create_customer.rb
centaman-4.0.4 lib/centaman/service/create_customer.rb
centaman-4.0.3 lib/centaman/service/create_customer.rb
centaman-4.0.2 lib/centaman/service/create_customer.rb
centaman-4.0.1 lib/centaman/service/create_customer.rb
centaman-3.1.2 lib/centaman/service/create_customer.rb
centaman-3.1.1 lib/centaman/service/create_customer.rb
centaman-3.1.0 lib/centaman/service/create_customer.rb
centaman-3.0.0 lib/centaman/service/create_customer.rb
centaman-2.1.0 lib/centaman/service/create_customer.rb
centaman-2.0.0 lib/centaman/service/create_customer.rb
centaman-1.0.0 lib/centaman/service/create_customer.rb
centaman-0.2.3 lib/centaman/service/create_customer.rb
centaman-0.2.2 lib/centaman/service/create_customer.rb
centaman-0.2.1 lib/centaman/service/create_customer.rb
centaman-0.2.0 lib/centaman/service/create_customer.rb
centaman-0.1.13 lib/centaman/service/create_customer.rb