Class: Assets::Rule

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium
Defined in:
lib/assets/rule.rb,
lib/assets/rule/file.rb,
lib/assets/rule/concat.rb,
lib/assets/rule/rename.rb,
lib/assets/rule/compile.rb,
lib/assets/rule/compile/css.rb,
lib/assets/rule/compile/javascript.rb,
lib/assets/rule/compile/javascript/coffescript.rb

Overview

Abstract base class for rules that generate assets

Direct Known Subclasses

Compile, Concat, File, Rename

Defined Under Namespace

Classes: Compile, Concat, File, Rename

Instance Method Summary collapse

Instance Method Details

#assetAsset

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return asset

Returns:



13
14
15
# File 'lib/assets/rule.rb', line 13

def asset
  Evaluator.new(self).asset
end

#bodyString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return body

Returns:

  • (String)


23
# File 'lib/assets/rule.rb', line 23

abstract_method :body

#fresh_at?(time) ⇒ true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if asset is fresh at specific time

Parameters:

  • time (Time)

Returns:

  • (true)

    if asset is fresh at time

  • (false)


64
65
66
# File 'lib/assets/rule.rb', line 64

def fresh_at?(time)
  time >= updated_at
end

#mimeMime

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return mime

Returns:



31
# File 'lib/assets/rule.rb', line 31

abstract_method :mime

#rename(name) ⇒ Rule::Rename

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return renamed asset

Parameters:

  • name (String)

Returns:



49
50
51
# File 'lib/assets/rule.rb', line 49

def rename(name)
  Rename.new(name, self)
end

#updated_atTime

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return updated at

Returns:

  • (Time)


39
# File 'lib/assets/rule.rb', line 39

abstract_method :updated_at