Class: Hubspot::Config

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

Overview

To hold Hubspot configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
12
13
14
15
16
# File 'lib/hubspot/config.rb', line 9

def initialize
  @access_token = nil
  @portal_id = nil
  @client_secret = nil
  @logger = initialize_logger
  @log_level = determine_log_level
  apply_log_level
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def access_token
  @access_token
end

#client_secretObject

Returns the value of attribute client_secret.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def client_secret
  @client_secret
end

#log_levelObject

Returns the value of attribute log_level.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def logger
  @logger
end

#open_timeoutObject

Returns the value of attribute open_timeout.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def open_timeout
  @open_timeout
end

#portal_idObject

Returns the value of attribute portal_id.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def portal_id
  @portal_id
end

#read_timeoutObject

Returns the value of attribute read_timeout.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def read_timeout
  @read_timeout
end

#timeoutObject

Returns the value of attribute timeout.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def timeout
  @timeout
end

#write_timeoutObject

Returns the value of attribute write_timeout.



6
7
8
# File 'lib/hubspot/config.rb', line 6

def write_timeout
  @write_timeout
end

Instance Method Details

#apply_log_levelObject

Apply the log level to the logger



19
20
21
# File 'lib/hubspot/config.rb', line 19

def apply_log_level
  @logger.level = @log_level
end