Class: Yamload::Loader
- Inherits:
-
Object
- Object
- Yamload::Loader
- Defined in:
- lib/yamload/loader.rb
Instance Method Summary collapse
- #content ⇒ Object
- #defaults ⇒ Object
- #defaults=(defaults) ⇒ Object
- #exist? ⇒ Boolean
-
#initialize(file, dir = Yamload.dir) ⇒ Loader
constructor
A new instance of Loader.
- #obj ⇒ Object
- #reload ⇒ Object
Constructor Details
Instance Method Details
#content ⇒ Object
17 18 19 |
# File 'lib/yamload/loader.rb', line 17 def content @content ||= IceNine.deep_freeze(content_with_defaults) end |
#defaults ⇒ Object
35 36 37 |
# File 'lib/yamload/loader.rb', line 35 def defaults defaults_merger.defaults end |
#defaults=(defaults) ⇒ Object
31 32 33 |
# File 'lib/yamload/loader.rb', line 31 def defaults=(defaults) defaults_merger.defaults = defaults end |
#exist? ⇒ Boolean
13 14 15 |
# File 'lib/yamload/loader.rb', line 13 def exist? @loader.exist? end |
#obj ⇒ Object
21 22 23 |
# File 'lib/yamload/loader.rb', line 21 def obj @immutable_obj ||= Conversion::Object.new(content).to_immutable end |
#reload ⇒ Object
25 26 27 28 29 |
# File 'lib/yamload/loader.rb', line 25 def reload @content = @immutable_obj = nil @loader.reload content end |