Class: RubyLokaliseApi::BaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_lokalise_api/base_client.rb

Overview

This class contains the base client. Inherited by Client (regular API client) and OAuth2Client (used for OAuth-2 based authentication)

Direct Known Subclasses

Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, params = {}) ⇒ BaseClient

Returns a new instance of BaseClient.



10
11
12
13
14
15
# File 'lib/ruby_lokalise_api/base_client.rb', line 10

def initialize(token, params = {})
  @token = token
  @timeout = params.fetch(:timeout, nil)
  @open_timeout = params.fetch(:open_timeout, nil)
  @token_header = ''
end

Instance Attribute Details

#open_timeoutObject

Returns the value of attribute open_timeout.



8
9
10
# File 'lib/ruby_lokalise_api/base_client.rb', line 8

def open_timeout
  @open_timeout
end

#timeoutObject

Returns the value of attribute timeout.



8
9
10
# File 'lib/ruby_lokalise_api/base_client.rb', line 8

def timeout
  @timeout
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/ruby_lokalise_api/base_client.rb', line 7

def token
  @token
end

#token_headerObject (readonly)

Returns the value of attribute token_header.



7
8
9
# File 'lib/ruby_lokalise_api/base_client.rb', line 7

def token_header
  @token_header
end