Class: Pain::Options
- Inherits:
-
Object
- Object
- Pain::Options
- Defined in:
- lib/pain/cli.rb
Overview
rubocop:disable Metrics/MethodLength
Class Method Summary collapse
Class Method Details
.create(options, model) ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/pain/cli.rb', line 132 def self.create(, model) OptionParser.new do |opts| opts.on( '-l', '--likelihood [LIKELIHOOD]', OptionParser::DecimalInteger, model.(:likelihood) ) do |like| [:likelihood] = model.normalize(like, :likelihood) end opts.on( '-i', '--impact [IMPACT]', OptionParser::DecimalInteger, model.(:impact) ) do |impact| [:impact] = model.normalize(impact, :impact) end opts.on( '-t', '--type [TYPE]', OptionParser::DecimalInteger, model.(:bug_type) ) do |bug_type| [:bug_type] = model.normalize(bug_type, :bug_type) end end end |