Class: Centaman::Service::AuthenticateMember
- Inherits:
-
Centaman::Service
- Object
- Wrapper
- Centaman::Service
- Centaman::Service::AuthenticateMember
- Includes:
- JsonWrapper
- Defined in:
- lib/centaman/service/authenticate_member.rb
Constant Summary
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#member_number ⇒ Object
readonly
Returns the value of attribute member_number.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
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
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
#email ⇒ Object (readonly)
Returns the value of attribute email.
5 6 7 |
# File 'lib/centaman/service/authenticate_member.rb', line 5 def email @email end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/centaman/service/authenticate_member.rb', line 5 def last_name @last_name end |
#member_number ⇒ Object (readonly)
Returns the value of attribute member_number.
5 6 7 |
# File 'lib/centaman/service/authenticate_member.rb', line 5 def member_number @member_number end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/centaman/service/authenticate_member.rb', line 5 def password @password end |
Instance Method Details
#after_init(args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/centaman/service/authenticate_member.rb', line 7 def after_init(args) @member_number = args.fetch(:member_number, nil).try(:to_i) @last_name = args.fetch(:last_name, nil) @email = args.fetch(:email, nil) @password = args.fetch(:password, nil) end |
#build_object(resp) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/centaman/service/authenticate_member.rb', line 22 def build_object(resp) return build_objects(resp) if resp.respond_to?(:map) return auth_error unless resp.respond_to?(:merge) @build_object ||= object_class.new(resp.merge(additional_hash_to_serialize_after_response)) end |
#endpoint ⇒ Object
14 15 16 |
# File 'lib/centaman/service/authenticate_member.rb', line 14 def endpoint '/member_services/Authentication' end |
#object_class ⇒ Object
18 19 20 |
# File 'lib/centaman/service/authenticate_member.rb', line 18 def object_class Centaman::Object::Member end |
#options_hash ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/centaman/service/authenticate_member.rb', line 29 def { 'MemberNumber' => member_number, 'Surname' => last_name, 'Email' => email, 'Password' => password }.to_json end |