Class: Waffle::Maker::Filter
- Inherits:
-
Object
- Object
- Waffle::Maker::Filter
- Defined in:
- lib/waffle/maker.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #default_options ⇒ Object
- #execute ⇒ Object
-
#initialize(argv) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
#initialize(argv) ⇒ Filter
Returns a new instance of Filter.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/waffle/maker.rb', line 21 def initialize(argv) (@options = ).tap do || OptionParser.new { |o| o. = "Usage: #{$0}" o.on("-f number", "Column number that contains the rails path") { |v| [:f] << v.to_i } o.on("-w number", "Column number that contains the waf path") { |v| [:w] << v.to_i } o.on("--silent-error", "Hide parsing errors, default is false") { |v| [:silent_error] << v } }.parse!(argv) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/waffle/maker.rb', line 13 def @options end |
Class Method Details
Instance Method Details
#default_options ⇒ Object
33 34 35 |
# File 'lib/waffle/maker.rb', line 33 def { f: 2, w: 2, silent_error: false } end |