Class: UserConfigurations::Configuration

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/user_configurations/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_name) ⇒ Configuration



7
8
9
10
# File 'lib/user_configurations/configuration.rb', line 7

def initialize(project_name)
  @project_name = project_name
  super global.merge(user).merge(environment).with_indifferent_access
end

Instance Attribute Details

#project_nameObject

Returns the value of attribute project_name.



5
6
7
# File 'lib/user_configurations/configuration.rb', line 5

def project_name
  @project_name
end

Instance Method Details

#store(values) ⇒ Object



12
13
14
15
# File 'lib/user_configurations/configuration.rb', line 12

def store(values)
  File.write user_file, YAML.dump(user.merge(values))
  merge! values
end