Class: Sprockets::ProcessedAsset::DependencyFile

Inherits:
Struct
  • Object
show all
Defined in:
lib/sprockets/processed_asset.rb

Instance Method Summary collapse

Constructor Details

#initialize(pathname, mtime, digest) ⇒ DependencyFile

Returns a new instance of DependencyFile


77
78
79
80
81
# File 'lib/sprockets/processed_asset.rb', line 77

def initialize(pathname, mtime, digest)
  pathname = Pathname.new(pathname) unless pathname.is_a?(Pathname)
  mtime    = Time.parse(mtime) if mtime.is_a?(String)
  super
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

83
84
85
86
87
88
# File 'lib/sprockets/processed_asset.rb', line 83

def eql?(other)
  other.is_a?(DependencyFile) &&
    pathname.eql?(other.pathname) &&
    mtime.eql?(other.mtime) &&
    digest.eql?(other.digest)
end

#hashObject


90
91
92
# File 'lib/sprockets/processed_asset.rb', line 90

def hash
  pathname.to_s.hash
end