Class: Command::StringArgument

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

Overview

Liberally accepts any string as input

Direct Known Subclasses

RestOfLineArgument

Instance Attribute Summary

Attributes inherited from Argument

#name, #value

Instance Method Summary collapse

Methods inherited from Argument

#check_present, #consume, #consume_hash, #match_terms, #omittable?, #parse, register, #required?

Constructor Details

#initialize(name, string) ⇒ StringArgument

Returns a new instance of StringArgument.



337
338
339
340
# File 'lib/command-set/arguments.rb', line 337

def initialize(name, string)
  super(name)
  @description = string
end

Instance Method Details

#complete(prefix, subject) ⇒ Object



342
343
344
# File 'lib/command-set/arguments.rb', line 342

def complete(prefix, subject)
  return [@description, ""]
end

#validate(term, subject) ⇒ Object



346
347
348
# File 'lib/command-set/arguments.rb', line 346

def validate(term, subject)
  return true
end