Class: Leftovers::Matchers::NodeHasPositionalArgument
- Inherits:
-
Object
- Object
- Leftovers::Matchers::NodeHasPositionalArgument
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/matchers/node_has_positional_argument.rb
Instance Method Summary collapse
- #===(node) ⇒ Object
-
#initialize(position) ⇒ NodeHasPositionalArgument
constructor
A new instance of NodeHasPositionalArgument.
Methods included from ComparableInstance
Constructor Details
#initialize(position) ⇒ NodeHasPositionalArgument
Returns a new instance of NodeHasPositionalArgument.
8 9 10 11 12 |
# File 'lib/leftovers/matchers/node_has_positional_argument.rb', line 8 def initialize(position) @position = position freeze end |
Instance Method Details
#===(node) ⇒ Object
14 15 16 17 18 |
# File 'lib/leftovers/matchers/node_has_positional_argument.rb', line 14 def ===(node) args = node.positional_arguments args.length > @position if args end |