Class: Peeky::Renderer::MethodSignatureWithDebugRender
- Inherits:
-
Object
- Object
- Peeky::Renderer::MethodSignatureWithDebugRender
- Defined in:
- lib/peeky/renderer/method_signature_with_debug_render.rb
Overview
Render: Method signature with debug code Stubbed Method Render
Example output:
def simple(first_param)
puts 'method name: simple'
puts first_param # first_param is a required positional paramater
end
def complex(aaa, bbb = nil, *ccc, ddd:, eee: nil, **fff, &ggg)
puts 'method name: complex'
puts aaa # aaa is a required positional paramater
puts bbb # bbb is an optional positional paramater
puts ccc # *ccc takes a list of positional params
puts ddd # ddd: is a required named parameter
puts eee # eee: is an optional named parameter
puts fff # **fff takes a list of optional named parameters
puts ggg # &ggg is block with many calling options, example - instance_eval(&block) if block_given?
end
Instance Attribute Summary collapse
-
#method_signature ⇒ Object
readonly
Method signature stores a MethodInfo object.
Instance Method Summary collapse
-
#initialize(method_signature, **_opts) ⇒ MethodSignatureWithDebugRender
constructor
A new instance of MethodSignatureWithDebugRender.
-
#render ⇒ Object
Render the method with debug statements for each parameter.
Constructor Details
#initialize(method_signature, **_opts) ⇒ MethodSignatureWithDebugRender
Returns a new instance of MethodSignatureWithDebugRender.
28 29 30 31 32 |
# File 'lib/peeky/renderer/method_signature_with_debug_render.rb', line 28 def initialize(method_signature, **_opts) @method_signature = method_signature @render_signature = Peeky::Renderer::MethodSignatureRender.new(method_signature) end |
Instance Attribute Details
#method_signature ⇒ Object (readonly)
Method signature stores a MethodInfo object
26 27 28 |
# File 'lib/peeky/renderer/method_signature_with_debug_render.rb', line 26 def method_signature @method_signature end |
Instance Method Details
#render ⇒ Object
Render the method with debug statements for each parameter
35 36 37 |
# File 'lib/peeky/renderer/method_signature_with_debug_render.rb', line 35 def render render_method end |