Class: Mini::Guard::XFile
- Inherits:
-
Object
- Object
- Mini::Guard::XFile
- Defined in:
- lib/mini/guard.rb
Instance Attribute Summary collapse
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #eql?(xfile) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(path, code:, specs:, views:, factories:) ⇒ XFile
constructor
A new instance of XFile.
- #to_s ⇒ Object
Constructor Details
#initialize(path, code:, specs:, views:, factories:) ⇒ XFile
Returns a new instance of XFile.
55 56 57 58 59 60 61 |
# File 'lib/mini/guard.rb', line 55 def initialize(path, code:, specs:, views:, factories:) @path = path stat = File.stat(path) @size = stat.size @last_modified = stat.ctime @associations = find_associations(code: code, specs: specs, views: views, factories: factories) end |
Instance Attribute Details
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
53 54 55 |
# File 'lib/mini/guard.rb', line 53 def associations @associations end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
53 54 55 |
# File 'lib/mini/guard.rb', line 53 def last_modified @last_modified end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
53 54 55 |
# File 'lib/mini/guard.rb', line 53 def path @path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
53 54 55 |
# File 'lib/mini/guard.rb', line 53 def size @size end |
Instance Method Details
#eql?(xfile) ⇒ Boolean
65 |
# File 'lib/mini/guard.rb', line 65 def eql?(xfile); self.path == xfile.path && self.last_modified == xfile.last_modified; end |
#hash ⇒ Object
64 |
# File 'lib/mini/guard.rb', line 64 def hash; "#{self.path}:#{self.last_modified}".hash; end |
#to_s ⇒ Object
63 |
# File 'lib/mini/guard.rb', line 63 def to_s; "file: #{path} size: #{size} last modified: #{last_modified} associations: #{associations}"; end |