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
-
#bottom_margin ⇒ Object
readonly
Returns the value of attribute bottom_margin.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#left_margin ⇒ Object
readonly
Returns the value of attribute left_margin.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#right_margin ⇒ Object
readonly
Returns the value of attribute right_margin.
-
#top_margin ⇒ Object
readonly
Returns the value of attribute top_margin.
Instance Method Summary collapse
-
#initialize(argv) ⇒ ArgumentParser
constructor
A new instance of ArgumentParser.
Constructor Details
#initialize(argv) ⇒ ArgumentParser
Returns a new instance of ArgumentParser.
15 16 17 18 19 20 21 22 23 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 15 def initialize(argv) parser.parse! 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
#bottom_margin ⇒ Object
Returns the value of attribute bottom_margin.
13 14 15 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 13 def bottom_margin @bottom_margin end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
12 13 14 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 12 def input @input end |
#left_margin ⇒ Object
Returns the value of attribute left_margin.
13 14 15 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 13 def left_margin @left_margin end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
12 13 14 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 12 def output @output end |
#right_margin ⇒ Object
Returns the value of attribute right_margin.
13 14 15 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 13 def right_margin @right_margin end |
#top_margin ⇒ Object
Returns the value of attribute top_margin.
13 14 15 |
# File 'lib/ghtml2pdf/argument_parser.rb', line 13 def top_margin @top_margin end |