Class: Appsignal::Config::ConfigDSL Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ ConfigDSL

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ConfigDSL.



603
604
605
606
# File 'lib/appsignal/config.rb', line 603

def initialize(config)
  @config = config
  @dsl_options = {}
end

Instance Attribute Details

#dsl_optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



601
602
603
# File 'lib/appsignal/config.rb', line 601

def dsl_options
  @dsl_options
end

Instance Method Details

#activate_if_environment(*envs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



625
626
627
# File 'lib/appsignal/config.rb', line 625

def activate_if_environment(*envs)
  self.active = envs.map(&:to_s).include?(env)
end

#app_pathObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



608
609
610
# File 'lib/appsignal/config.rb', line 608

def app_path
  @config.root_path
end

#envObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



612
613
614
# File 'lib/appsignal/config.rb', line 612

def env
  @config.env
end

#env?(given_env) ⇒ TrueClass, FalseClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if the given environment name matches the loaded environment name.

Parameters:

  • given_env (String, Symbol)

Returns:

  • (TrueClass, FalseClass)


621
622
623
# File 'lib/appsignal/config.rb', line 621

def env?(given_env)
  env == given_env.to_s
end