Class: Packer::Macro

Inherits:
Object
  • Object
show all
Defined in:
lib/packer/macro.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



4
5
6
7
# File 'lib/packer/macro.rb', line 4

def method_missing(method_name, *args)
  name = method_name.to_s.slice(0,1).capitalize + method_name.to_s.slice(1..-1)
  "{{ .#{name} }}"
end

Instance Method Details

#respond_to?(symbol, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/packer/macro.rb', line 9

def respond_to?(symbol, include_private=false)
  # We literally respond to everything...
  true
end