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
38 39 40 |
# File 'lib/sportdb/cli/opts.rb', line 38 def data_path @data_path || '.' end |
#data_path=(value) ⇒ Object
34 35 36 |
# File 'lib/sportdb/cli/opts.rb', line 34 def data_path=(value) @data_path = value end |
#db_name ⇒ Object
30 31 32 |
# File 'lib/sportdb/cli/opts.rb', line 30 def db_name @db_name || 'sport.db' end |
#db_path ⇒ Object
26 27 28 |
# File 'lib/sportdb/cli/opts.rb', line 26 def db_path @db_path || '.' end |
#merge_gli_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? @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 ??
16 17 18 |
# File 'lib/sportdb/cli/opts.rb', line 16 def verbose=(boolean) # add: alias for debug ?? @verbose = boolean end |
#verbose? ⇒ Boolean
20 21 22 23 |
# File 'lib/sportdb/cli/opts.rb', line 20 def verbose? return false if @verbose.nil? # default verbose/debug flag is false @verbose == true end |
#world_data_path ⇒ Object
43 44 45 |
# File 'lib/sportdb/cli/opts.rb', line 43 def world_data_path @world_data_path # NB: option has no default; return nil end |