Class: CollinsShell::Util::AssetStache

Inherits:
Mustache
  • Object
show all
Defined in:
lib/collins_shell/util/asset_stache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset) ⇒ AssetStache

Returns a new instance of AssetStache.



8
9
10
# File 'lib/collins_shell/util/asset_stache.rb', line 8

def initialize asset
  @asset = asset
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/collins_shell/util/asset_stache.rb', line 21

def method_missing meth, *args, &block
  result = asset.send(meth.to_sym)
  if result.nil? then
    super
  else
    result
  end
end

Instance Attribute Details

#assetObject

Returns the value of attribute asset.



6
7
8
# File 'lib/collins_shell/util/asset_stache.rb', line 6

def asset
  @asset
end

Instance Method Details

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
# File 'lib/collins_shell/util/asset_stache.rb', line 12

def respond_to? meth
  result = asset.send(meth.to_sym)
  if result.nil? then
    super
  else
    result
  end
end