123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Support::BlockSignature Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: RSpec::Support::MethodSignature
Defined in: rspec-support/lib/rspec/support/method_signature_verifier.rb

Overview

Deals with the slightly different semantics of block arguments. For methods, arguments are required unless a default value is provided. For blocks, arguments are optional, even if no default value is provided.

However, we want to treat block args as required since you virtually always want to pass a value for each received argument and our and_yield has treated block args as required for many years.

Constant Summary

MethodSignature - Inherited

INFINITY

Class Method Summary

MethodSignature - Inherited

Instance Attribute Summary

MethodSignature - Inherited

#arbitrary_kw_args?

See additional method definition at line 98.

#max_non_kw_args, #min_non_kw_args, #optional_kw_args, #required_kw_args,
#unlimited_args?

See additional method definition at line 102.

Instance Method Summary

MethodSignature - Inherited

#classify_arity,
#could_contain_kw_args?

Without considering what the last arg is, could it contain keyword arguments?

#description

See additional method definition at line 51.

#has_kw_args_in?

If the last argument is Hash, Ruby will treat only symbol keys as keyword arguments the rest will be grouped in another Hash and passed as positional argument.

#invalid_kw_args_from

See additional method definition at line 77.

#missing_kw_args_from

See additional method definition at line 73.

#non_kw_args_arity_description, #valid_non_kw_args?,
#classify_parameters

Instance Method Details

#classify_parameters

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 270

def classify_parameters
  super
  @min_non_kw_args = @max_non_kw_args unless @max_non_kw_args == INFINITY
end