Class: Coffer::Configuration
- Inherits:
-
Object
- Object
- Coffer::Configuration
- Defined in:
- lib/coffer/configuration.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
- #add(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_config ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 |
# File 'lib/coffer/configuration.rb', line 6 def initialize @fields = [] end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
4 5 6 |
# File 'lib/coffer/configuration.rb', line 4 def fields @fields end |
Instance Method Details
#add(key, value) ⇒ Object
10 11 12 |
# File 'lib/coffer/configuration.rb', line 10 def add( key, value ) @fields << [ key, value ] end |
#to_config ⇒ Object
14 15 16 |
# File 'lib/coffer/configuration.rb', line 14 def to_config @fields.map { |f| f.join('=') }.join("\n") end |