Class: Command::RegexpArgument

Inherits:
Argument
  • Object
show all
Defined in:
lib/command-set/arguments.rb

Overview

Input must match the regular expression passed to create this Argument

Instance Attribute Summary

Attributes inherited from Argument

#name

Instance Method Summary collapse

Methods inherited from Argument

#basis, #check_present, #consume, #consume_hash, #initialize, #match_terms, #names, #omittable?, #parse, register, #required?, #subject_requirements

Constructor Details

This class inherits a constructor from Command::Argument

Instance Method Details

#complete(terms, prefix, subject) ⇒ Object



185
186
187
# File 'lib/command-set/arguments.rb', line 185

def complete(terms, prefix, subject)
  return [prefix]
end

#validate(term, subject) ⇒ Object



189
190
191
# File 'lib/command-set/arguments.rb', line 189

def validate(term, subject)
  return basis(subject) =~ term
end