Class: Donatello::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/donatello.rb

Overview

rubocop:disable Style/Documentation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_locationObject

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

#schemaObject



55
56
57
# File 'lib/donatello.rb', line 55

def schema
  @schema ||= YAML.load_file(schema_location)
end