Class: Assets::Rule::File

Inherits:
Assets::Rule show all
Defined in:
lib/assets/rule/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Assets::Rule

#asset, #fresh_at?, #rename

Instance Attribute Details

#nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return name

Returns:

  • (String)


22
23
24
# File 'lib/assets/rule/file.rb', line 22

def name
  @name
end

#pathString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return path

TODO: Remove this

Returns:

  • (String)


14
15
16
# File 'lib/assets/rule/file.rb', line 14

def path
  @path
end

Instance Method Details

#bodyString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return body of asset

Returns:

  • (String)


41
42
43
# File 'lib/assets/rule/file.rb', line 41

def body
  ::File.binread(path)
end

#extnameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return extname

Returns:

  • (String)


30
31
32
# File 'lib/assets/rule/file.rb', line 30

def extname
  ::File.extname(path)
end

#mimeMime

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return mime type

Returns:



51
52
53
# File 'lib/assets/rule/file.rb', line 51

def mime
  Mime.extname(extname)
end

#updated_atTime

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return modification time

Returns:

  • (Time)


62
63
64
# File 'lib/assets/rule/file.rb', line 62

def updated_at
  ::File.mtime(path)
end