Class: Assets::Rule::File
- Inherits:
-
Assets::Rule
- Object
- Assets::Rule
- Assets::Rule::File
- Defined in:
- lib/assets/rule/file.rb
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
private
Return name.
-
#path ⇒ String
readonly
private
Return path.
Instance Method Summary collapse
-
#body ⇒ String
private
Return body of asset.
-
#extname ⇒ String
private
Return extname.
-
#mime ⇒ Mime
private
Return mime type.
-
#updated_at ⇒ Time
private
Return modification time.
Methods inherited from Assets::Rule
Instance Attribute Details
#name ⇒ String (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
22 23 24 |
# File 'lib/assets/rule/file.rb', line 22 def name @name end |
#path ⇒ String (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
14 15 16 |
# File 'lib/assets/rule/file.rb', line 14 def path @path end |
Instance Method Details
#body ⇒ String
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
41 42 43 |
# File 'lib/assets/rule/file.rb', line 41 def body ::File.binread(path) end |
#extname ⇒ String
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
30 31 32 |
# File 'lib/assets/rule/file.rb', line 30 def extname ::File.extname(path) end |
#mime ⇒ Mime
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
51 52 53 |
# File 'lib/assets/rule/file.rb', line 51 def mime Mime.extname(extname) end |
#updated_at ⇒ Time
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
62 63 64 |
# File 'lib/assets/rule/file.rb', line 62 def updated_at ::File.mtime(path) end |