Class: Radical::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/radical/asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/radical/asset.rb', line 5

def path
  @path
end

Instance Method Details

#contentObject



16
17
18
# File 'lib/radical/asset.rb', line 16

def content
  File.read(full_path)
end

#extObject



20
21
22
# File 'lib/radical/asset.rb', line 20

def ext
  File.extname(@filename)
end

#full_pathObject



12
13
14
# File 'lib/radical/asset.rb', line 12

def full_path
  File.join(path, @filename)
end