Class: Thinreports::Preview::Option
- Inherits:
-
Hash
- Object
- Hash
- Thinreports::Preview::Option
- Defined in:
- lib/thinreports/preview/option.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(args) ⇒ Option
Returns a new instance of Option.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/thinreports/preview/option.rb', line 6 def initialize(args) super nil self[:output] = './generate' self[:list_loop] = 1 op = OptionParser.new op.on('-t', '--target VAL') { |v| self[:target] = v } op.on('-o', '--output VAL') { |v| self[:output] = v.gsub(/[\/\\"]$/,'') } op.on('-l', '--list-loop VAL') { |v| self[:list_loop] = v.to_i } op.parse!(args) end |