Class: ActiveRecord::Turntable::Configuration::Loader::DSL
- Inherits:
-
Object
- Object
- ActiveRecord::Turntable::Configuration::Loader::DSL
- Defined in:
- lib/active_record/turntable/configuration/loader/dsl.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, configuration = Configuration.new) ⇒ DSL
constructor
A new instance of DSL.
- #load ⇒ Object
Constructor Details
#initialize(path, configuration = Configuration.new) ⇒ DSL
Returns a new instance of DSL.
6 7 8 9 10 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 6 def initialize(path, configuration = Configuration.new) @path = path @configuration = configuration @dsl = DSL.new(@configuration) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 4 def configuration @configuration end |
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
4 5 6 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 4 def dsl @dsl end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 4 def path @path end |
Class Method Details
.load(path, configuration = Configuration.new) ⇒ Object
12 13 14 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 12 def self.load(path, configuration = Configuration.new) new(path, configuration).load end |
Instance Method Details
#load ⇒ Object
16 17 18 19 20 |
# File 'lib/active_record/turntable/configuration/loader/dsl.rb', line 16 def load @dsl.instance_eval(File.read(@path), @path, 1) configuration end |