Class: Adhearsion::Configuration::RailsConfiguration

Inherits:
AbstractConfiguration show all
Defined in:
lib/adhearsion/initializer/configuration.rb

Constant Summary collapse

SUPPORTED_RAILS_ENVIRONMENTS =
[:development, :test, :production]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConfigurationEntryPoint

#add_configuration_for

Constructor Details

#initialize(options) ⇒ RailsConfiguration

Returns a new instance of RailsConfiguration.

Raises:

  • (ArgumentError)


230
231
232
233
234
235
236
# File 'lib/adhearsion/initializer/configuration.rb', line 230

def initialize(options)
  path_to_rails, environment = check_options options
  @rails_root = File.expand_path(path_to_rails)
  @environment = environment.to_sym
  raise ArgumentError, "Unrecognized environment type #@environment. Supported: " +
    SUPPORTED_RAILS_ENVIRONMENTS.to_sentence unless SUPPORTED_RAILS_ENVIRONMENTS.include?(@environment)
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



229
230
231
# File 'lib/adhearsion/initializer/configuration.rb', line 229

def environment
  @environment
end

#rails_rootObject

Returns the value of attribute rails_root.



229
230
231
# File 'lib/adhearsion/initializer/configuration.rb', line 229

def rails_root
  @rails_root
end