Class: YAMLFileStruct
Instance Attribute Summary
Attributes inherited from FileStruct
#basename, #ext, #path, #version
Instance Method Summary
collapse
Methods inherited from FileStruct
#basic_name, #initialize
Constructor Details
This class inherits a constructor from FileStruct
Instance Method Details
#content ⇒ Object
62
63
64
|
# File 'lib/file_struct.rb', line 62
def content
@content ||= @doc.to_yaml
end
|
#doc ⇒ Object
49
50
51
|
# File 'lib/file_struct.rb', line 49
def doc
@doc ||= YAML.load(@content)
end
|
#reload! ⇒ Object
53
54
55
56
|
# File 'lib/file_struct.rb', line 53
def reload!
super
@doc = YAML.load(@content)
end
|
#save! ⇒ Object
58
59
60
|
# File 'lib/file_struct.rb', line 58
def save!
@content = @doc.to_yaml
end
|