Class: Donatello::Config
- Inherits:
-
Object
- Object
- Donatello::Config
- Defined in:
- lib/donatello.rb
Overview
rubocop:disable Style/Documentation
Instance Attribute Summary collapse
-
#schema_location ⇒ Object
Returns the value of attribute schema_location.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #schema ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
43 44 45 46 47 48 49 50 51 |
# File 'lib/donatello.rb', line 43 def initialize @schema_location = if defined?(Rails) Rails.root.join( "config", "serialization_schema.yml" ) else File.join(Dir.pwd, "config", "serialization_schema.yaml") end end |
Instance Attribute Details
#schema_location ⇒ Object
Returns the value of attribute schema_location.
53 54 55 |
# File 'lib/donatello.rb', line 53 def schema_location @schema_location end |
Instance Method Details
#schema ⇒ Object
55 56 57 |
# File 'lib/donatello.rb', line 55 def schema @schema ||= YAML.load_file(schema_location) end |