class NumRu::Misc::KeywordOptAutoHelp
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
NumRu::Misc::KeywordOpt.new
# File lib/numru/misc/keywordopt.rb, line 372 def initialize(*args) args.push(['help', false, 'show help message if true']) super(*args) end
Public Instance Methods
interpret(hash)
click to toggle source
Calls superclass method
NumRu::Misc::KeywordOpt#interpret
# File lib/numru/misc/keywordopt.rb, line 377 def interpret(hash) begin out = super(hash) rescue raise $!.inspect + "\n Available parameters are:\n" + help end if out['help'] puts "<< Description of options >>\n" + help puts ' Current values=' + out.inspect raise Misc::HelpMessagingException, '** help messaging done **' end out end
set(hash)
click to toggle source
Calls superclass method
NumRu::Misc::KeywordOpt#set
# File lib/numru/misc/keywordopt.rb, line 391 def set(hash) raise ArgumentError, "not a hash" if !hash.is_a?(Hash) if hash['help'] puts "<< Description of options >>\n" + help raise Misc::HelpMessagingException, '** help messaging done **' end super end