Class: Middleman::Sprockets::ImportedAsset

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-sprockets/imported_asset.rb

Overview

ImportedAsset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logical_path, output_path = nil) ⇒ ImportedAsset

Create instance

Parameters:

  • logical_path (Pathname)

    The logical path to the asset given in config.rb

  • output_dir (proc)

    An individual output directory for that particular asset



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/middleman-sprockets/imported_asset.rb', line 15

def initialize logical_path, output_path = nil
  @logical_path = Pathname.new logical_path

  if output_path.respond_to? :call
    if output_path.arity.abs == 1
      output_path = output_path.call(@logical_path)
    else
      output_path = output_path.call
    end
  end

  @output_path = Pathname.new output_path if output_path
end

Instance Attribute Details

#logical_pathObject (readonly)

Returns the value of attribute logical_path.



6
7
8
# File 'lib/middleman-sprockets/imported_asset.rb', line 6

def logical_path
  @logical_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



6
7
8
# File 'lib/middleman-sprockets/imported_asset.rb', line 6

def output_path
  @output_path
end