Class: Rake::Pipeline::ManifestEntry
- Inherits:
-
Object
- Object
- Rake::Pipeline::ManifestEntry
- Defined in:
- lib/rake-pipeline/manifest_entry.rb
Overview
Represents a single entry in a dynamic dependency Manifest.
Instance Attribute Summary collapse
-
#deps ⇒ Object
Returns the value of attribute deps.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Create a new entry from the given hash.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #as_json ⇒ Object
-
#initialize(deps = {}, mtime = nil) ⇒ ManifestEntry
constructor
A new instance of ManifestEntry.
Constructor Details
#initialize(deps = {}, mtime = nil) ⇒ ManifestEntry
Returns a new instance of ManifestEntry.
20 21 22 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 20 def initialize(deps={}, mtime=nil) @deps, @mtime = deps, mtime end |
Instance Attribute Details
#deps ⇒ Object
Returns the value of attribute deps.
18 19 20 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 18 def deps @deps end |
#mtime ⇒ Object
Returns the value of attribute mtime.
18 19 20 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 18 def mtime @mtime end |
Class Method Details
.from_hash(hash) ⇒ Object
Create a new entry from the given hash.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 6 def self.from_hash(hash) entry = new entry.mtime = DateTime.parse(hash["mtime"]).to_time hash["deps"].each do |dep, time_string| entry.deps[dep] = DateTime.parse(time_string).to_time end entry end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 28 def ==(other) mtime == other.mtime deps == other.deps end |
#as_json ⇒ Object
24 25 26 |
# File 'lib/rake-pipeline/manifest_entry.rb', line 24 def as_json { :deps => @deps, :mtime => @mtime } end |