Class: Adhearsion::Configuration::RailsConfiguration
- Inherits:
-
AbstractConfiguration
- Object
- AbstractConfiguration
- Adhearsion::Configuration::RailsConfiguration
- Defined in:
- lib/adhearsion/initializer/configuration.rb
Constant Summary collapse
- SUPPORTED_RAILS_ENVIRONMENTS =
[:development, :test, :production]
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#rails_root ⇒ Object
Returns the value of attribute rails_root.
Instance Method Summary collapse
-
#initialize(options) ⇒ RailsConfiguration
constructor
A new instance of RailsConfiguration.
Methods included from ConfigurationEntryPoint
Constructor Details
#initialize(options) ⇒ RailsConfiguration
Returns a new instance of RailsConfiguration.
230 231 232 233 234 235 236 |
# File 'lib/adhearsion/initializer/configuration.rb', line 230 def initialize() path_to_rails, environment = @rails_root = File.(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
#environment ⇒ Object
Returns the value of attribute environment.
229 230 231 |
# File 'lib/adhearsion/initializer/configuration.rb', line 229 def environment @environment end |
#rails_root ⇒ Object
Returns the value of attribute rails_root.
229 230 231 |
# File 'lib/adhearsion/initializer/configuration.rb', line 229 def rails_root @rails_root end |