Class: OptionsParser
- Inherits:
-
Object
- Object
- OptionsParser
- Defined in:
- lib/html2markdown/options_parser.rb
Instance Attribute Summary collapse
-
#html2md ⇒ Object
Returns the value of attribute html2md.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ OptionsParser
constructor
A new instance of OptionsParser.
- #parse ⇒ Object
Constructor Details
#initialize(options) ⇒ OptionsParser
Returns a new instance of OptionsParser.
6 7 8 9 10 11 12 13 14 |
# File 'lib/html2markdown/options_parser.rb', line 6 def initialize() @options = if option?(:output_dir) @html2md = Html2MarkdownCli.new([:output_dir]) else @html2md = Html2MarkdownCli.new end end |
Instance Attribute Details
#html2md ⇒ Object
Returns the value of attribute html2md.
4 5 6 |
# File 'lib/html2markdown/options_parser.rb', line 4 def html2md @html2md end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/html2markdown/options_parser.rb', line 4 def @options end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/html2markdown/options_parser.rb', line 16 def parse if option?(:file) parse_file elsif option?(:dir) parse_dir else puts "No options specified. See --help for options" end end |