Class: Copypasta::Settings

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

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_definitionsObject (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