Class: Cipherpipe::Configuration
- Inherits:
-
Object
- Object
- Cipherpipe::Configuration
- Defined in:
- lib/cipherpipe/configuration.rb
Constant Summary collapse
- FILENAME =
".cipherpipe.yml"
- UnknownFormatterError =
Class.new Cipherpipe::Error
Instance Attribute Summary collapse
-
#external_sources ⇒ Object
readonly
Returns the value of attribute external_sources.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
-
#initialize(filename = FILENAME) ⇒ Configuration
constructor
A new instance of Configuration.
- #variables ⇒ Object
- #variables=(hash) ⇒ Object
Constructor Details
#initialize(filename = FILENAME) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 |
# File 'lib/cipherpipe/configuration.rb', line 10 def initialize(filename = FILENAME) @filename = filename parse! end |
Instance Attribute Details
#external_sources ⇒ Object (readonly)
Returns the value of attribute external_sources.
8 9 10 |
# File 'lib/cipherpipe/configuration.rb', line 8 def external_sources @external_sources end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/cipherpipe/configuration.rb', line 8 def file @file end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
8 9 10 |
# File 'lib/cipherpipe/configuration.rb', line 8 def format @format end |
Instance Method Details
#variables ⇒ Object
16 17 18 |
# File 'lib/cipherpipe/configuration.rb', line 16 def variables formatter.read File.read(file) end |
#variables=(hash) ⇒ Object
20 21 22 |
# File 'lib/cipherpipe/configuration.rb', line 20 def variables=(hash) File.write file, formatter.write(hash) if file end |