Class: PomHelperTemplate

Inherits:
Template show all
Defined in:
lib/generators/templates/helpers/pom_helper_template.rb

Instance Method Summary collapse

Methods inherited from Template

#initialize, #parsed_body

Constructor Details

This class inherits a constructor from Template

Instance Method Details

#bodyObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/templates/helpers/pom_helper_template.rb', line 4

def body
  <<~EOF
    module Raider
      module PomHelper
        def instance
          @instance ||= new
        end

        def method_missing(message, *args, &block)
          return super unless instance.respond_to?(message)

          instance.public_send(message, *args, &block)
        end

        def respond_to_missing?(method, *_args, &block)
          instance.respond_to?(method) || super
        end
      end
    end
  EOF
end