Class: Hem::AssetApplicator
- Inherits:
-
Object
- Object
- Hem::AssetApplicator
- Defined in:
- lib/hem/asset_applicator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call(file, opts = {}) ⇒ Object
-
#initialize(name, pattern, block) ⇒ AssetApplicator
constructor
A new instance of AssetApplicator.
- #matches?(file) ⇒ Boolean
Constructor Details
#initialize(name, pattern, block) ⇒ AssetApplicator
Returns a new instance of AssetApplicator.
38 39 40 41 42 |
# File 'lib/hem/asset_applicator.rb', line 38 def initialize(name, pattern, block) @name = name @pattern = pattern @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
36 37 38 |
# File 'lib/hem/asset_applicator.rb', line 36 def name @name end |
Instance Method Details
#call(file, opts = {}) ⇒ Object
48 49 50 |
# File 'lib/hem/asset_applicator.rb', line 48 def call(file, opts = {}) @block.call file, opts end |
#matches?(file) ⇒ Boolean
44 45 46 |
# File 'lib/hem/asset_applicator.rb', line 44 def matches?(file) @pattern.match(file) end |