Class: Tnw::Configuration
- Inherits:
-
Object
- Object
- Tnw::Configuration
- Defined in:
- lib/tnw/configuration.rb
Instance Attribute Summary collapse
-
#authentication_handler ⇒ Object
readonly
Returns the value of attribute authentication_handler.
-
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
-
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
-
#metrics_accepted_clock_skew ⇒ Object
Returns the value of attribute metrics_accepted_clock_skew.
-
#metrics_ingestion_token ⇒ Object
Returns the value of attribute metrics_ingestion_token.
-
#metrics_retention ⇒ Object
Returns the value of attribute metrics_retention.
-
#metrics_sample_interval ⇒ Object
Returns the value of attribute metrics_sample_interval.
Instance Method Summary collapse
- #authenticate_with(&block) ⇒ Object
- #basic_auth_configured? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 |
# File 'lib/tnw/configuration.rb', line 13 def initialize @metrics_sample_interval = 5.seconds @metrics_retention = 7.days @metrics_ingestion_token = nil @metrics_accepted_clock_skew = 30.seconds @authentication_handler = nil @basic_auth_username = nil @basic_auth_password = nil end |
Instance Attribute Details
#authentication_handler ⇒ Object (readonly)
Returns the value of attribute authentication_handler.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def authentication_handler @authentication_handler end |
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def basic_auth_password @basic_auth_password end |
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def basic_auth_username @basic_auth_username end |
#metrics_accepted_clock_skew ⇒ Object
Returns the value of attribute metrics_accepted_clock_skew.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def metrics_accepted_clock_skew @metrics_accepted_clock_skew end |
#metrics_ingestion_token ⇒ Object
Returns the value of attribute metrics_ingestion_token.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def metrics_ingestion_token @metrics_ingestion_token end |
#metrics_retention ⇒ Object
Returns the value of attribute metrics_retention.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def metrics_retention @metrics_retention end |
#metrics_sample_interval ⇒ Object
Returns the value of attribute metrics_sample_interval.
5 6 7 |
# File 'lib/tnw/configuration.rb', line 5 def metrics_sample_interval @metrics_sample_interval end |
Instance Method Details
#authenticate_with(&block) ⇒ Object
43 44 45 46 47 |
# File 'lib/tnw/configuration.rb', line 43 def authenticate_with(&block) raise ArgumentError, "authenticate_with requires a block" unless block @authentication_handler = block end |
#basic_auth_configured? ⇒ Boolean
57 58 59 |
# File 'lib/tnw/configuration.rb', line 57 def basic_auth_configured? basic_auth_username && basic_auth_password end |
#inspect ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/tnw/configuration.rb', line 61 def inspect token = metrics_ingestion_token.nil? ? nil : "[FILTERED]" password = basic_auth_password.nil? ? nil : "[FILTERED]" "#<#{self.class.name} " \ "metrics_sample_interval=#{metrics_sample_interval.inspect} " \ "metrics_retention=#{metrics_retention.inspect} " \ "metrics_ingestion_token=#{token.inspect} " \ "metrics_accepted_clock_skew=#{metrics_accepted_clock_skew.inspect} " \ "authentication_handler=#{authentication_handler.inspect} " \ "basic_auth_username=#{basic_auth_username.inspect} " \ "basic_auth_password=#{password.inspect}>" end |