Class: Packer::Macro
- Inherits:
-
Object
- Object
- Packer::Macro
- Defined in:
- lib/packer/macro.rb
Instance Method Summary collapse
-
#method_missing(method_name, *args) ⇒ Object
rubocop:disable Style/MethodMissingSuper.
- #respond_to?(symbol, include_private = false) ⇒ Boolean
-
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissingSuper.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
rubocop:disable Style/MethodMissingSuper
6 7 8 9 |
# File 'lib/packer/macro.rb', line 6 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
16 17 18 19 |
# File 'lib/packer/macro.rb', line 16 def respond_to?(symbol, include_private=false) # We literally respond to everything... true end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissingSuper
12 13 14 |
# File 'lib/packer/macro.rb', line 12 def respond_to_missing?(method_name, include_private = false) true end |