Class: Centaman::Service::UpdateMember
- Inherits:
-
Centaman::Service
- Object
- Wrapper
- Centaman::Service
- Centaman::Service::UpdateMember
- Includes:
- JsonWrapper
- Defined in:
- lib/centaman/service/update_member.rb
Constant Summary
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#date_of_birth ⇒ Object
readonly
Returns the value of attribute date_of_birth.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#gender ⇒ Object
readonly
Returns the value of attribute gender.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_primary ⇒ Object
readonly
Returns the value of attribute is_primary.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
Attributes inherited from Wrapper
#api_password, #api_token, #api_url, #api_username, #proxie_host, #proxie_password, #proxie_port, #proxie_user
Instance Method Summary collapse
- #after_init(args) ⇒ Object
- #build_object(resp) ⇒ Object
- #endpoint ⇒ Object
- #object_class ⇒ Object
- #options_hash ⇒ Object
- #options_hash_no_json ⇒ Object
Methods included from JsonWrapper
#additional_hash_to_serialize_after_response, #build_objects, #final_object_class, #objects
Methods inherited from Centaman::Service
#after_post, #fetch_all, #post, #put
Methods inherited from Wrapper
#generate_token, #headers, #initialize, #options, #payload, #payload_key, #proxy_hash, #wrap_request_in_case_of_timeout
Constructor Details
This class inherits a constructor from Centaman::Wrapper
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def address @address end |
#date_of_birth ⇒ Object (readonly)
Returns the value of attribute date_of_birth.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def date_of_birth @date_of_birth end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def email @email end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def first_name @first_name end |
#gender ⇒ Object (readonly)
Returns the value of attribute gender.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def gender @gender end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def id @id end |
#is_primary ⇒ Object (readonly)
Returns the value of attribute is_primary.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def is_primary @is_primary end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def last_name @last_name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def password @password end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
7 8 9 |
# File 'lib/centaman/service/update_member.rb', line 7 def phone @phone end |
Instance Method Details
#after_init(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/centaman/service/update_member.rb', line 10 def after_init(args) @id = args[:id].try(:to_i) @first_name = args[:first_name].try(:squish) @last_name = args[:last_name].try(:squish) @address = args[:address].try(:symbolize_keys) @gender = args[:gender] @date_of_birth = args[:date_of_birth] @phone = args[:phone] @email = args[:email].try(:squish) @password = args[:password] @is_primary = args[:is_primary] end |
#build_object(resp) ⇒ Object
31 32 33 34 |
# File 'lib/centaman/service/update_member.rb', line 31 def build_object(resp) return update_error(resp) unless resp.respond_to?(:merge) @build_object ||= object_class.new(resp.merge(additional_hash_to_serialize_after_response)) end |
#endpoint ⇒ Object
23 24 25 |
# File 'lib/centaman/service/update_member.rb', line 23 def endpoint "/member_services/Member/#{id}" end |
#object_class ⇒ Object
27 28 29 |
# File 'lib/centaman/service/update_member.rb', line 27 def object_class Centaman::Object::Member end |
#options_hash ⇒ Object
49 50 51 |
# File 'lib/centaman/service/update_member.rb', line 49 def .compact.to_json end |
#options_hash_no_json ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/centaman/service/update_member.rb', line 36 def { 'FirstName' => first_name.try(:upcase), 'LastName' => last_name.try(:upcase), 'HomeAddress' => home_address, 'Gender' => gender, 'DateOfBirth' => date_of_birth, 'Email' => email.try(:upcase), 'Password' => password, 'IsPrimary' => is_primary } end |