Class: Fixturizer::Configuration
- Inherits:
-
Object
- Object
- Fixturizer::Configuration
- Defined in:
- lib/fixturizer/configuration.rb
Instance Attribute Summary collapse
-
#datasets ⇒ Object
readonly
Returns the value of attribute datasets.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#models ⇒ Object
readonly
Returns the value of attribute models.
-
#models_order ⇒ Object
readonly
Returns the value of attribute models_order.
-
#models_type ⇒ Object
readonly
Returns the value of attribute models_type.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(filename:) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(filename:) ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 |
# File 'lib/fixturizer/configuration.rb', line 9 def initialize(filename:) @filename = filename @content = read_file(filename:) @rules = @content[:fixtures][:rules] @models_type = @content[:fixtures].dig(:models, :type) @models = @content[:fixtures].dig(:models, :definitions) @models_order = @content[:fixtures].dig(:models, :order) @datasets = @content[:fixtures][:datasets] end |
Instance Attribute Details
#datasets ⇒ Object (readonly)
Returns the value of attribute datasets.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def datasets @datasets end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def filename @filename end |
#models ⇒ Object (readonly)
Returns the value of attribute models.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def models @models end |
#models_order ⇒ Object (readonly)
Returns the value of attribute models_order.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def models_order @models_order end |
#models_type ⇒ Object (readonly)
Returns the value of attribute models_type.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def models_type @models_type end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
7 8 9 |
# File 'lib/fixturizer/configuration.rb', line 7 def rules @rules end |