Skip to content

method_missing always gets a block #3469

Description

@Asmod4n

When method_missing gets triggered it always gets a block, even when not passed.

class MissingError
  def method_missing(method, *args, &block)
    if block_given?
      puts "block_given?"
    end
    if block
      puts "block"
    end
  end
end

missing_error = MissingError.new
missing_error.hello

Expected result would be nothing, but both assume a block gets passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions