Class: SportDb::Opts
- Inherits:
-
Object
- Object
- SportDb::Opts
- Defined in:
- lib/sportdb/cli/opts.rb
Instance Method Summary collapse
- #data_path ⇒ Object
- #data_path=(value) ⇒ Object
- #db_name ⇒ Object
- #db_path ⇒ Object
- #event ⇒ Object
- #event=(value) ⇒ Object
- #merge_commander_options!(options = {}) ⇒ Object
- #world_data_path ⇒ Object
Instance Method Details
#data_path ⇒ Object
37 38 39 |
# File 'lib/sportdb/cli/opts.rb', line 37 def data_path @data_path || '.' end |
#data_path=(value) ⇒ Object
33 34 35 |
# File 'lib/sportdb/cli/opts.rb', line 33 def data_path=(value) @data_path = value end |
#db_name ⇒ Object
20 21 22 |
# File 'lib/sportdb/cli/opts.rb', line 20 def db_name @db_name || 'sport.db' end |
#db_path ⇒ Object
16 17 18 |
# File 'lib/sportdb/cli/opts.rb', line 16 def db_path @db_path || '.' end |
#event ⇒ Object
28 29 30 |
# File 'lib/sportdb/cli/opts.rb', line 28 def event @event # NB: option has no default; return nil ## || '.' end |
#event=(value) ⇒ Object
24 25 26 |
# File 'lib/sportdb/cli/opts.rb', line 24 def event=(value) @event = value end |
#merge_commander_options!(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/sportdb/cli/opts.rb', line 5 def ( = {} ) @db_path = [:dbpath] if [:dbpath].present? @db_name = [:dbname] if [:dbname].present? @data_path = [:include] if [:include].present? @event = [:event] if [:event].present? @world_data_path = [:worldinclude] if [:worldinclude].present? end |
#world_data_path ⇒ Object
42 43 44 |
# File 'lib/sportdb/cli/opts.rb', line 42 def world_data_path @world_data_path # NB: option has no default; return nil end |