Class: Copypasta::Settings
- Inherits:
-
Object
- Object
- Copypasta::Settings
- Defined in:
- lib/copypasta/settings.rb
Instance Attribute Summary collapse
-
#parameter_definitions ⇒ Object
readonly
Returns the value of attribute parameter_definitions.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
9 10 11 |
# File 'lib/copypasta/settings.rb', line 9 def initialize @parameter_definitions = {} end |
Instance Attribute Details
#parameter_definitions ⇒ Object (readonly)
Returns the value of attribute parameter_definitions.
7 8 9 |
# File 'lib/copypasta/settings.rb', line 7 def parameter_definitions @parameter_definitions end |
Class Method Details
.from_file(path) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/copypasta/settings.rb', line 13 def self.from_file(path) require "copypasta/settings_dsl" raise "#{path} doesn't exist." unless File.exist?(path) dsl = Copypasta::SettingsDSL.new dsl.instance_eval File.read(path), path dsl.settings end |