Module: OptimusPrime::ClassMethods
- Defined in:
- lib/optimus_prime.rb
Instance Method Summary collapse
- #__optor__ ⇒ Object
- #command(name, &block) ⇒ Object
- #commands ⇒ Object
- #flag(*flags) ⇒ Object
- #help(name) ⇒ Object
- #init(instance) ⇒ Object
- #option(*names) ⇒ Object
Instance Method Details
#__optor__ ⇒ Object
36 37 38 |
# File 'lib/optimus_prime.rb', line 36 def __optor__ @__optor__ ||= Optor.new(self, ARGV.dup) end |
#command(name, &block) ⇒ Object
48 49 50 |
# File 'lib/optimus_prime.rb', line 48 def command(name, &block) __optor__.command(name, block) end |
#commands ⇒ Object
52 53 54 |
# File 'lib/optimus_prime.rb', line 52 def commands __optor__.commands.keys end |
#flag(*flags) ⇒ Object
56 57 58 |
# File 'lib/optimus_prime.rb', line 56 def flag(*flags) flags.each { |name| __optor__.flag(name) } end |
#help(name) ⇒ Object
44 45 46 |
# File 'lib/optimus_prime.rb', line 44 def help(name) __optor__.help(name) end |
#init(instance) ⇒ Object
40 41 42 |
# File 'lib/optimus_prime.rb', line 40 def init(instance) __optor__.init(instance) end |
#option(*names) ⇒ Object
60 61 62 63 |
# File 'lib/optimus_prime.rb', line 60 def option(*names) = names.last.is_a?(Hash) ? names.pop : {} names.each { |name| __optor__.option(name, ) } end |