Class: Y2Network::ConfigReader
- Inherits:
-
Object
- Object
- Y2Network::ConfigReader
- Includes:
- Yast::Logger
- Defined in:
- src/lib/y2network/config_reader.rb
Overview
This class is responsible for reading the configuration from the system
It implements a #read method which returns a configuration object containing the information from the corresponding backend.
It is expect that a configuration reader exists for each supported backend by inheriting from this class.
Direct Known Subclasses
Class Method Summary collapse
-
.for(source, *opts) ⇒ Y2Network::Autoinst::ConfigReader, Y2Network::Wicked::ConfigReader
Returns a configuration reader for a given source.
Instance Method Summary collapse
-
#initialize(_opts = {}) ⇒ ConfigReader
constructor
A new instance of ConfigReader.
-
#read ⇒ Y2Network::IssuesResult
Returns the configuration from the given backend.
Constructor Details
#initialize(_opts = {}) ⇒ ConfigReader
Returns a new instance of ConfigReader.
47 |
# File 'src/lib/y2network/config_reader.rb', line 47 def initialize(_opts = {}); end |
Class Method Details
.for(source, *opts) ⇒ Y2Network::Autoinst::ConfigReader, Y2Network::Wicked::ConfigReader
Returns a configuration reader for a given source
39 40 41 42 43 44 |
# File 'src/lib/y2network/config_reader.rb', line 39 def for(source, *opts) require "y2network/#{source}/config_reader" modname = source.to_s.split("_").map(&:capitalize).join klass = Y2Network.const_get("#{modname}::ConfigReader") klass.new(*opts) end |
Instance Method Details
#read ⇒ Y2Network::IssuesResult
Returns the configuration from the given backend
53 54 55 |
# File 'src/lib/y2network/config_reader.rb', line 53 def read raise NotImplementedError end |