Class: Gluey::Dependencies::SingleFile
- Inherits:
-
Object
- Object
- Gluey::Dependencies::SingleFile
show all
- Defined in:
- lib/gluey/dependencies/single_file.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(file, **data) ⇒ SingleFile
Returns a new instance of SingleFile.
6
7
8
9
|
# File 'lib/gluey/dependencies/single_file.rb', line 6
def initialize(file, **data)
@file = file
@data = data
end
|
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4
5
6
|
# File 'lib/gluey/dependencies/single_file.rb', line 4
def data
@data
end
|
#file ⇒ Object
Returns the value of attribute file.
4
5
6
|
# File 'lib/gluey/dependencies/single_file.rb', line 4
def file
@file
end
|
Instance Method Details
#==(other) ⇒ Object
24
25
26
|
# File 'lib/gluey/dependencies/single_file.rb', line 24
def ==(other)
@file == other.file
end
|
#actualize ⇒ Object
11
12
13
14
|
# File 'lib/gluey/dependencies/single_file.rb', line 11
def actualize
@mtime = File.mtime(@file).to_i
self
end
|
#changed? ⇒ Boolean
16
17
18
|
# File 'lib/gluey/dependencies/single_file.rb', line 16
def changed?
File.mtime(@file).to_i != @mtime rescue true
end
|
#exists? ⇒ Boolean
20
21
22
|
# File 'lib/gluey/dependencies/single_file.rb', line 20
def exists?
File.exists? @file
end
|