Class: FsCache::Attributes::Size

Inherits:
FsCache::Attribute show all
Defined in:
lib/fs_cache/attributes/size.rb

Overview

Size attribute. Can be:

  • Integer: File size

Defined Under Namespace

Modules: Helpers

Instance Method Summary collapse

Methods inherited from FsCache::Attribute

#invalidated_on_change_of

Instance Method Details

#attribute_for(file) ⇒ Object

Get the attribute for a given file

Parameters
  • file (String): File to get the attribute for

Result
  • Object: Corresponding attribute value



15
16
17
# File 'lib/fs_cache/attributes/size.rb', line 15

def attribute_for(file)
  File.stat(file).size
end