Class: Sprockets::Helpers::BasePath

Inherits:
Object
  • Object
show all
Defined in:
lib/sprockets/helpers/base_path.rb

Direct Known Subclasses

AssetPath, FilePath

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, options = {}) ⇒ BasePath

Returns a new instance of BasePath.



15
16
17
18
# File 'lib/sprockets/helpers/base_path.rb', line 15

def initialize(uri, options = {})
  @uri = uri
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

The various options used when generating the path.



12
13
14
# File 'lib/sprockets/helpers/base_path.rb', line 12

def options
  @options
end

#uriObject (readonly)

The parsed URI from which to generate the full path to the asset.



9
10
11
# File 'lib/sprockets/helpers/base_path.rb', line 9

def uri
  @uri
end

Instance Method Details

#to_sObject

Returns the full path to the asset, complete with timestamp.



22
23
24
25
26
27
28
# File 'lib/sprockets/helpers/base_path.rb', line 22

def to_s
  rewrite_path
  rewrite_query
  rewrite_host

  uri.to_s
end