Class: Hem::AssetApplicator

Inherits:
Object
  • Object
show all
Defined in:
lib/hem/asset_applicator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

Returns:

  • (Boolean)


44
45
46
# File 'lib/hem/asset_applicator.rb', line 44

def matches?(file)
  @pattern.match(file)
end