Class: GLI::OptionParsingResult

Inherits:
Object
  • Object
show all
Defined in:
lib/gli/option_parsing_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



6
7
8
# File 'lib/gli/option_parsing_result.rb', line 6

def arguments
  @arguments
end

#cli_optionsObject

Returns the value of attribute cli_options.



8
9
10
# File 'lib/gli/option_parsing_result.rb', line 8

def cli_options
  @cli_options
end

#commandObject

Returns the value of attribute command.



4
5
6
# File 'lib/gli/option_parsing_result.rb', line 4

def command
  @command
end

#command_optionsObject

Returns the value of attribute command_options.



5
6
7
# File 'lib/gli/option_parsing_result.rb', line 5

def command_options
  @command_options
end

#global_optionsObject

Returns the value of attribute global_options.



3
4
5
# File 'lib/gli/option_parsing_result.rb', line 3

def global_options
  @global_options
end

Instance Method Details

#convert_to_openstruct!Object



10
11
12
13
14
# File 'lib/gli/option_parsing_result.rb', line 10

def convert_to_openstruct!
  @global_options  = Options.new(@global_options)
  @command_options = Options.new(@command_options)
  self
end

#to_aObject

Allows us to splat this object into blocks and methods expecting parameters in this order



17
18
19
# File 'lib/gli/option_parsing_result.rb', line 17

def to_a
  [@global_options,@command,@command_options,@arguments]
end