Class: Radical::Asset
- Inherits:
-
Object
- Object
- Radical::Asset
- Defined in:
- lib/radical/asset.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #content ⇒ Object
- #ext ⇒ Object
- #full_path ⇒ Object
-
#initialize(filename, path:) ⇒ Asset
constructor
A new instance of Asset.
Constructor Details
#initialize(filename, path:) ⇒ Asset
Returns a new instance of Asset.
7 8 9 10 |
# File 'lib/radical/asset.rb', line 7 def initialize(filename, path:) @filename = filename @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/radical/asset.rb', line 5 def path @path end |
Instance Method Details
#content ⇒ Object
16 17 18 |
# File 'lib/radical/asset.rb', line 16 def content File.read(full_path) end |
#ext ⇒ Object
20 21 22 |
# File 'lib/radical/asset.rb', line 20 def ext File.extname(@filename) end |
#full_path ⇒ Object
12 13 14 |
# File 'lib/radical/asset.rb', line 12 def full_path File.join(path, @filename) end |