Class: GHtml2Pdf::ArgumentParser
- Inherits:
-
Object
- Object
- GHtml2Pdf::ArgumentParser
- Defined in:
- lib/ghtml2pdf/argument_parser.rb
Overview
Parses the command line arguments
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(argv) ⇒ ArgumentParser
constructor
A new instance of ArgumentParser.
Constructor Details
#initialize(argv) ⇒ ArgumentParser
Returns a new instance of ArgumentParser.
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
#input ⇒ Object (readonly)
Returns the value of attribute input.
7 8 9 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 7 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 7 def output @output end |