Class: YAMLFileStruct

Inherits:
FileStruct show all
Defined in:
lib/file_struct.rb

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

#contentObject



62
63
64
# File 'lib/file_struct.rb', line 62

def content
  @content ||= @doc.to_yaml
end

#docObject



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