Class: RSpec::Support::BlockSignature Private
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
MethodSignature
|
|
Instance Chain:
self,
MethodSignature
|
|
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
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
- #classify_parameters Internal use only
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 | Alias for MethodSignature#classify_arity. |
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