Class: TooDoo::Arguments

Inherits:
Object
  • Object
show all
Defined in:
lib/toodoo/arguments.rb

Overview

Arguments is intended to handle passed args and transform it into command name and its arguments I dont want to use OptionParser!

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args_array = ARGV) ⇒ Arguments

Returns a new instance of Arguments.



10
11
12
13
14
# File 'lib/toodoo/arguments.rb', line 10

def initialize(args_array = ARGV)
  @args_array = Array(args_array)
  @command    = recognize_command
  @argument   = recognize_arguments
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



8
9
10
# File 'lib/toodoo/arguments.rb', line 8

def argument
  @argument
end

#commandObject (readonly)

Returns the value of attribute command.



8
9
10
# File 'lib/toodoo/arguments.rb', line 8

def command
  @command
end