Class: ZohoBooks::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/zoho_books/config.rb

Constant Summary collapse

DEFAULT_BASE_URL =
"https://accounts.zoho.eu".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/zoho_books/config.rb', line 8

def initialize(config = {})
  @base_url = config["base_url"] || DEFAULT_BASE_URL
  @portal_id = config["portal_id"]
  @access_token = config["access_token"]
  @client_id = config["client_id"]
  @client_secret = config["client_secret"]
  @redirect_uri = config["redirect_uri"]
  @organization_id = config["organization_id"]
  @refresh_token = config["refresh_token"]

  @access_token_expires_at = nil
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def access_token
  @access_token
end

#access_token_expires_atObject

Returns the value of attribute access_token_expires_at.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def access_token_expires_at
  @access_token_expires_at
end

#base_urlObject

Returns the value of attribute base_url.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def base_url
  @base_url
end

#client_idObject

Returns the value of attribute client_id.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def client_secret
  @client_secret
end

#organization_idObject

Returns the value of attribute organization_id.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def organization_id
  @organization_id
end

#portal_idObject

Returns the value of attribute portal_id.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def portal_id
  @portal_id
end

#redirect_uriObject

Returns the value of attribute redirect_uri.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def redirect_uri
  @redirect_uri
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



3
4
5
# File 'lib/zoho_books/config.rb', line 3

def refresh_token
  @refresh_token
end