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
- #merge_gli_options!(options = {}) ⇒ Object
-
#verbose=(boolean) ⇒ Object
add: alias for debug ??.
- #verbose? ⇒ Boolean
- #world_data_path ⇒ Object
Instance Method Details
#data_path ⇒ Object
40 41 42 |
# File 'lib/sportdb/cli/opts.rb', line 40 def data_path @data_path || '.' end |
#data_path=(value) ⇒ Object
36 37 38 |
# File 'lib/sportdb/cli/opts.rb', line 36 def data_path=(value) @data_path = value end |
#db_name ⇒ Object
32 33 34 |
# File 'lib/sportdb/cli/opts.rb', line 32 def db_name @db_name || 'sport.db' end |
#db_path ⇒ Object
28 29 30 |
# File 'lib/sportdb/cli/opts.rb', line 28 def db_path @db_path || '.' end |
#merge_gli_options!(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/sportdb/cli/opts.rb', line 7 def ( = {} ) @db_path = [:dbpath] if [:dbpath].present? @db_name = [:dbname] if [:dbname].present? @verbose = true if [:verbose] == true @data_path = [:include] if [:include].present? @world_data_path = [:worldinclude] if [:worldinclude].present? end |
#verbose=(boolean) ⇒ Object
add: alias for debug ??
18 19 20 |
# File 'lib/sportdb/cli/opts.rb', line 18 def verbose=(boolean) # add: alias for debug ?? @verbose = boolean end |
#verbose? ⇒ Boolean
22 23 24 25 |
# File 'lib/sportdb/cli/opts.rb', line 22 def verbose? return false if @verbose.nil? # default verbose/debug flag is false @verbose == true end |
#world_data_path ⇒ Object
45 46 47 |
# File 'lib/sportdb/cli/opts.rb', line 45 def world_data_path @world_data_path # NB: option has no default; return nil end |