Class: Confy::Core
- Inherits:
-
Object
- Object
- Confy::Core
- Defined in:
- lib/confy/core.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Core
constructor
A new instance of Core.
- #inspect ⇒ Object
- #parse ⇒ Object
Constructor Details
#initialize(*args) ⇒ Core
Returns a new instance of Core.
4 5 6 7 8 9 10 11 |
# File 'lib/confy/core.rb', line 4 def initialize *args @path, *rest = args tail = rest.pop if tail.is_a?(Hash) tail end raise FileNotFoundError unless @path && File.exist?(@path) end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
3 4 5 |
# File 'lib/confy/core.rb', line 3 def backend @backend end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/confy/core.rb', line 3 def path @path end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/confy/core.rb', line 13 def inspect backend ? backend.inspect : "<Confy::Core>" end |
#parse ⇒ Object
17 18 19 20 |
# File 'lib/confy/core.rb', line 17 def parse @backend ||= Backend::Base.which(@path) @backend.new @path end |