Class: Centaman::Service::CreateCustomer
- Inherits:
-
Centaman::Service
- Object
- Wrapper
- Centaman::Service
- Centaman::Service::CreateCustomer
- Includes:
- JsonWrapper
- Defined in:
- lib/centaman/service/create_customer.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Centaman::Service
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
Attributes inherited from Wrapper
#api_password, #api_token, #api_username
Instance Method Summary collapse
-
#address ⇒ Object
rubocop:disable Metrics/MethodLength.
- #after_init(args) ⇒ Object
- #endpoint ⇒ Object
- #object_class ⇒ Object
-
#options_hash ⇒ Object
rubocop:disable Metrics/MethodLength.
Methods included from JsonWrapper
#additional_hash_to_serialize_after_response, #build_object, #build_objects, #objects
Methods inherited from Centaman::Service
#after_post, #fetch_all, #payload, #payload_key, #post, #wrap_request_in_case_of_timeout
Methods inherited from Wrapper
#generate_token, #headers, #initialize, #options
Constructor Details
This class inherits a constructor from Centaman::Wrapper
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
5 6 7 |
# File 'lib/centaman/service/create_customer.rb', line 5 def email @email end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
5 6 7 |
# File 'lib/centaman/service/create_customer.rb', line 5 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/centaman/service/create_customer.rb', line 5 def last_name @last_name end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
5 6 7 |
# File 'lib/centaman/service/create_customer.rb', line 5 def phone @phone end |
Instance Method Details
#address ⇒ Object
rubocop:disable Metrics/MethodLength
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/centaman/service/create_customer.rb', line 23 def address { 'Street1' => '', 'Street2' => '', 'City' => '', 'State' => '', 'Postalcode' => '', 'Country' => '', 'HomePhone' => phone, 'WorkPhone' => '', 'MobilePhone' => '' } end |
#after_init(args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/centaman/service/create_customer.rb', line 7 def after_init(args) @first_name = args[:first_name] @last_name = args[:last_name] @email = args[:email] @phone = args[:phone] end |
#endpoint ⇒ Object
14 15 16 |
# File 'lib/centaman/service/create_customer.rb', line 14 def endpoint '/ticket_services/TimedTicket' end |
#object_class ⇒ Object
18 19 20 |
# File 'lib/centaman/service/create_customer.rb', line 18 def object_class Centaman::Object::Customer end |
#options_hash ⇒ Object
rubocop:disable Metrics/MethodLength
39 40 41 42 43 44 45 46 |
# File 'lib/centaman/service/create_customer.rb', line 39 def { 'FirstName' => first_name, 'LastName' => last_name, 'Email' => email, 'Address' => address }.to_json end |