Class: Atol::Request::GetToken
- Inherits:
-
Object
- Object
- Atol::Request::GetToken
- Defined in:
- lib/atol/request/get_token.rb
Constant Summary collapse
- PATH =
'/getToken'
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config: nil) ⇒ GetToken
constructor
A new instance of GetToken.
Constructor Details
#initialize(config: nil) ⇒ GetToken
Returns a new instance of GetToken.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/atol/request/get_token.rb', line 11 def initialize(config: nil) @config = config || Atol.config raise(Atol::ConfigExpectedError) unless @config.is_a?(Atol::Config) if @config.login.nil? || @config.login.empty? raise(Atol::MissingConfigError, 'login missing') else @login = @config.login end if @config.password.nil? || @config.login.empty? raise(Atol::MissingConfigError, 'password missing') else @password = @config.password end @http_client = @config.http_client end |