Class: Yamload::Loading::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/yamload/loading/yaml.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, dir) ⇒ Yaml

Returns a new instance of Yaml.



7
8
9
10
# File 'lib/yamload/loading/yaml.rb', line 7

def initialize(file, dir)
  @file = file
  @dir = dir
end

Instance Method Details

#contentObject



16
17
18
# File 'lib/yamload/loading/yaml.rb', line 16

def content
  @content ||= IceNine.deep_freeze(load)
end

#exist?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/yamload/loading/yaml.rb', line 12

def exist?
  File.exist?(filepath)
end

#reloadObject



20
21
22
23
# File 'lib/yamload/loading/yaml.rb', line 20

def reload
  @content = @immutable_obj = nil
  content
end