Class: Adjective::Configuration
- Inherits:
-
Object
- Object
- Adjective::Configuration
- Defined in:
- lib/adjective.rb
Instance Attribute Summary collapse
-
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
-
#migration_path ⇒ Object
Returns the value of attribute migration_path.
-
#models_path ⇒ Object
Returns the value of attribute models_path.
-
#root ⇒ Object
Returns the value of attribute root.
-
#use_active_record ⇒ Object
Returns the value of attribute use_active_record.
-
#use_rails ⇒ Object
Returns the value of attribute use_rails.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_new_root(root_path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/adjective.rb', line 40 def initialize @use_active_record = true @use_rails = defined?(Rails) ? true : false # Need to set this up to ensure that if AR is off, it doesn't auto-set shit. @root = use_rails ? Rails.root : "." @config_file_path = "#{root}/config/initializers/adjective.rb" @migration_path = "#{root}/db/migrate" @models_path = "#{root}/app/models" end |
Instance Attribute Details
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
38 39 40 |
# File 'lib/adjective.rb', line 38 def config_file_path @config_file_path end |
#migration_path ⇒ Object
Returns the value of attribute migration_path.
38 39 40 |
# File 'lib/adjective.rb', line 38 def migration_path @migration_path end |
#models_path ⇒ Object
Returns the value of attribute models_path.
38 39 40 |
# File 'lib/adjective.rb', line 38 def models_path @models_path end |
#root ⇒ Object
Returns the value of attribute root.
38 39 40 |
# File 'lib/adjective.rb', line 38 def root @root end |
#use_active_record ⇒ Object
Returns the value of attribute use_active_record.
38 39 40 |
# File 'lib/adjective.rb', line 38 def use_active_record @use_active_record end |
#use_rails ⇒ Object
Returns the value of attribute use_rails.
38 39 40 |
# File 'lib/adjective.rb', line 38 def use_rails @use_rails end |
Instance Method Details
#set_new_root(root_path) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/adjective.rb', line 52 def set_new_root(root_path) @root = root_path @config_file_path = "#{root_path}/config/initializers/adjective.rb" @migration_path = "#{root_path}/db/migrate" @models_path = "#{root_path}/app/models" end |