Module: Transpec::Syntax::Mixin::AnyInstanceBlock
- Extended by:
- ActiveSupport::Concern
- Includes:
- Send
- Included in:
- MessagingHost
- Defined in:
- lib/transpec/syntax/mixin/any_instance_block.rb
Defined Under Namespace
Classes: AnyInstanceBlockRecord, MonkeyPatchAnyInstanceBlockRecord
Instance Method Summary collapse
Methods included from Send
#arg_node, #arg_nodes, #arg_range, #args_range, #method_name, #parentheses_range, #range_after_arg, #range_in_between_receiver_and_selector, #range_in_between_selector_and_arg, #receiver_node, #receiver_range, #selector_range
Instance Method Details
#add_receiver_arg_to_any_instance_implementation_block! ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 14 def add_receiver_arg_to_any_instance_implementation_block! return unless any_instance_block_node first_arg_node = any_instance_block_node.children[1].children[0] return unless first_arg_node first_arg_name = first_arg_node.children.first return if first_arg_name == :instance insert_before(first_arg_node.loc.expression, 'instance, ') true end |