Class: ConfigSL::FileFormat::Base Abstract
- Inherits:
-
Object
- Object
- ConfigSL::FileFormat::Base
- Defined in:
- lib/configsl/file_format/base.rb
Overview
This class is abstract.
Subclass and override ‘#read` and `.extensions` to implement a
Base class for file format support.
file format.
Class Method Summary collapse
-
.extensions ⇒ Array<Symbol>
Extensions used to identify the file format.
Instance Method Summary collapse
-
#initialize(file) ⇒ Base
constructor
A new instance of Base.
-
#read ⇒ Hash{Symbol => Object}
Reads the file and returns a hash of configuration values.
Constructor Details
#initialize(file) ⇒ Base
10 11 12 |
# File 'lib/configsl/file_format/base.rb', line 10 def initialize(file) @file = file end |
Class Method Details
.extensions ⇒ Array<Symbol>
Extensions used to identify the file format.
Values should be returned in order of preference.
19 20 21 |
# File 'lib/configsl/file_format/base.rb', line 19 def self.extensions [] end |
Instance Method Details
#read ⇒ Hash{Symbol => Object}
Reads the file and returns a hash of configuration values.
28 29 30 |
# File 'lib/configsl/file_format/base.rb', line 28 def read raise NotImplementedError, 'Not implemented' end |