Class: Agendrix::Nethris::Client
- Inherits:
-
Object
- Object
- Agendrix::Nethris::Client
- Defined in:
- lib/agendrix/nethris/client.rb
Defined Under Namespace
Modules: Vendor
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#vendor ⇒ Object
readonly
Returns the value of attribute vendor.
Instance Method Summary collapse
- #employees ⇒ Object
-
#initialize(vendor:, session_id: nil, user_code: nil, password: nil, business_code: nil) ⇒ Client
constructor
A new instance of Client.
- #send_request(**args) ⇒ Object
Constructor Details
#initialize(vendor:, session_id: nil, user_code: nil, password: nil, business_code: nil) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/agendrix/nethris/client.rb', line 14 def initialize(vendor:, session_id: nil, user_code: nil, password: nil, business_code: nil) unless vendor.in?([Vendor::NETHRIS, Vendor::EMPLOYER_D]) raise TypeError, "Vendor must be one of :#{Vendor::NETHRIS} or :#{Vendor::EMPLOYER_D}" end @vendor = vendor @session = Services::SessionService.new( vendor: @vendor, id: session_id, business_code: business_code, user_code: user_code, password: password ) end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
9 10 11 |
# File 'lib/agendrix/nethris/client.rb', line 9 def session @session end |
#vendor ⇒ Object (readonly)
Returns the value of attribute vendor.
9 10 11 |
# File 'lib/agendrix/nethris/client.rb', line 9 def vendor @vendor end |
Instance Method Details
#employees ⇒ Object
29 30 31 |
# File 'lib/agendrix/nethris/client.rb', line 29 def employees @employees ||= Services::EmployeeService.new(self) end |