Class: Trout::VersionList
- Inherits:
-
Object
- Object
- Trout::VersionList
- Defined in:
- lib/trout/version_list.rb
Constant Summary collapse
- FILE_VERSION =
'1.0'
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#files ⇒ Object
Returns the value of attribute files.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #<<(managed_file) ⇒ Object
- #[](filename) ⇒ Object
- #[]=(filename, managed_file) ⇒ Object
-
#initialize(path) ⇒ VersionList
constructor
A new instance of VersionList.
Constructor Details
#initialize(path) ⇒ VersionList
Returns a new instance of VersionList.
10 11 12 |
# File 'lib/trout/version_list.rb', line 10 def initialize(path) @path = path end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/trout/version_list.rb', line 8 def data @data end |
#files ⇒ Object
Returns the value of attribute files.
8 9 10 |
# File 'lib/trout/version_list.rb', line 8 def files @files end |
#path ⇒ Object
Returns the value of attribute path.
8 9 10 |
# File 'lib/trout/version_list.rb', line 8 def path @path end |
Instance Method Details
#<<(managed_file) ⇒ Object
26 27 28 |
# File 'lib/trout/version_list.rb', line 26 def <<(managed_file) self[managed_file.filename] = managed_file end |
#[](filename) ⇒ Object
14 15 16 17 18 |
# File 'lib/trout/version_list.rb', line 14 def [](filename) read attributes = files[filename] || { :filename => filename } ManagedFile.new(attributes) end |
#[]=(filename, managed_file) ⇒ Object
20 21 22 23 24 |
# File 'lib/trout/version_list.rb', line 20 def []=(filename, managed_file) read files[filename] = managed_file.to_hash write end |