Class: Markedly::Asset

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

Direct Known Subclasses

CssAsset

Constant Summary collapse

ASSETS_DIR =
File.expand_path('../../../assets', __FILE__)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Asset

Returns a new instance of Asset.



13
14
15
16
17
18
# File 'lib/markedly/asset.rb', line 13

def initialize(path)
  @path = path
  ext = File.extname(@path)
  @name = File.basename(path, ext)
  prepare_href
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



11
12
13
# File 'lib/markedly/asset.rb', line 11

def href
  @href
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/markedly/asset.rb', line 9

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/markedly/asset.rb', line 10

def path
  @path
end

Instance Method Details

#remote?Boolean

Returns:

  • (Boolean)


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

def remote?
  @remote
end