Sha256: e7e43a83fd8a98f7d934f2267cbd428fd7ce16e5b3a8a83e7a36508bd0733dbf
Contents?: true
Size: 776 Bytes
Versions: 4
Compression:
Stored size: 776 Bytes
Contents
# frozen_string_literal: true module Leftovers module AST class SendNode < Node include HasArguments alias_method :receiver, :first alias_method :name, :second alias_method :to_sym, :second def to_s name.to_s end def arguments @memo[:arguments] ||= if block_pass_argument? children[2...-1] else children.drop(2) end end def as_arguments_list first.as_arguments_list if name == :freeze end def block_pass_argument? last_child = children.last last_child.respond_to?(:type) && last_child.type == :block_pass end def block_given? block_pass_argument? || parent&.type == :block end end end end
Version data entries
4 entries across 4 versions & 1 rubygems