Class: GHtml2Pdf::ArgumentParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ghtml2pdf/argument_parser.rb

Overview

Parses the command line arguments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ ArgumentParser

Returns a new instance of ArgumentParser.

Raises:



9
10
11
12
13
# File 'lib/ghtml2pdf/argument_parser.rb', line 9

def initialize(argv)
  @input, @output, = argv
  raise MissingArgument, 'An input filename is required' unless @input
  raise MissingArgument, 'An output filename is required' unless @output
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



7
8
9
# File 'lib/ghtml2pdf/argument_parser.rb', line 7

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



7
8
9
# File 'lib/ghtml2pdf/argument_parser.rb', line 7

def output
  @output
end