Class: Aliyun::Log::Config

Inherits:
Aliyun::Log::Common::AttrStruct show all
Defined in:
lib/aliyun/log/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Aliyun::Log::Common::AttrStruct

#to_s

Methods included from Aliyun::Log::Common::AttrStruct::AttrHelper

#attrs

Constructor Details

#initialize(opts = {}) ⇒ Config

Returns a new instance of Config.



26
27
28
29
30
31
32
33
34
35
# File 'lib/aliyun/log/config.rb', line 26

def initialize(opts = {})
  super(opts)
  @open_timeout ||= self.class.open_timeout
  @read_timeout ||= self.class.read_timeout
  @access_key_id ||= self.class.access_key_id
  @access_key_secret ||= self.class.access_key_secret
  @endpoint ||= self.class.endpoint
  normalize_endpoint
  raise 'Missing AccessKeyID or AccessKeySecret' if @access_key_id.nil? || @access_key_secret.nil?
end

Class Attribute Details

.access_key_idObject

Returns the value of attribute access_key_id.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def access_key_id
  @access_key_id
end

.access_key_secretObject

Returns the value of attribute access_key_secret.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def access_key_secret
  @access_key_secret
end

.endpointObject

Returns the value of attribute endpoint.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def endpoint
  @endpoint
end

.log_fileObject

Returns the value of attribute log_file.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def log_file
  @log_file
end

.log_levelObject

Returns the value of attribute log_level.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def log_level
  @log_level
end

.open_timeoutObject

Returns the value of attribute open_timeout.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def open_timeout
  @open_timeout
end

.projectObject

Returns the value of attribute project.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def project
  @project
end

.read_timeoutObject

Returns the value of attribute read_timeout.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def read_timeout
  @read_timeout
end

.timestampsObject

Returns the value of attribute timestamps.



14
15
16
# File 'lib/aliyun/log/config.rb', line 14

def timestamps
  @timestamps
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



18
19
20
# File 'lib/aliyun/log/config.rb', line 18

def configure
  yield self
end