Class: BindableBlock::ArgAligner
- Inherits:
-
Object
- Object
- BindableBlock::ArgAligner
- Defined in:
- lib/bindable_block.rb
Overview
match args to arity, since instance_method has lambda properties
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args, instance_method) ⇒ ArgAligner
constructor
A new instance of ArgAligner.
Constructor Details
#initialize(args, instance_method) ⇒ ArgAligner
Returns a new instance of ArgAligner.
7 8 9 10 11 12 |
# File 'lib/bindable_block.rb', line 7 def initialize(args, instance_method) @result, @args, @parameters = [], args, instance_method.parameters.map(&:first) take num :req take [num(:opt), args.size].min take args.size if has? :rest end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'lib/bindable_block.rb', line 14 def call result end |