class Markedly::Asset

Constants

ASSETS_DIR

Attributes

href[R]
name[R]
path[R]

Public Class Methods

new(path) click to toggle source
# File lib/markedly/asset.rb, line 13
def initialize(path)
  @path = path
  ext = File.extname(@path)
  @name = File.basename(path, ext)
  prepare_href
end

Public Instance Methods

remote?() click to toggle source
# File lib/markedly/asset.rb, line 20
def remote?
  @remote
end

Private Instance Methods

prepare_href() click to toggle source
# File lib/markedly/asset.rb, line 26
def prepare_href
  if @path =~ /^https?:\/\//
    @href = @path
    @remote = true
  else
    @href = Addressable::URI.convert_path(@path).to_s
    @remote = false
  end
end