Class: BeerDb::Opts
- Inherits:
-
Object
- Object
- BeerDb::Opts
- Defined in:
- lib/beerdb/cli/opts.rb
Instance Method Summary collapse
- #data_path ⇒ Object
- #data_path=(value) ⇒ Object
- #db_name ⇒ Object
- #db_path ⇒ Object
- #merge_commander_options!(options = {}) ⇒ Object
- #world_data_path ⇒ Object
Instance Method Details
#data_path ⇒ Object
30 31 32 |
# File 'lib/beerdb/cli/opts.rb', line 30 def data_path @data_path || '.' end |
#data_path=(value) ⇒ Object
26 27 28 |
# File 'lib/beerdb/cli/opts.rb', line 26 def data_path=(value) @data_path = value end |
#db_name ⇒ Object
21 22 23 |
# File 'lib/beerdb/cli/opts.rb', line 21 def db_name @db_name || 'beer.db' end |
#db_path ⇒ Object
17 18 19 |
# File 'lib/beerdb/cli/opts.rb', line 17 def db_path @db_path || '.' end |
#merge_commander_options!(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/beerdb/cli/opts.rb', line 6 def ( = {} ) @db_path = [:dbpath] if [:dbpath].present? @db_name = [:dbname] if [:dbname].present? @data_path = [:include] if [:include].present? @world_data_path = [:worldinclude] if [:worldinclude].present? end |
#world_data_path ⇒ Object
34 35 36 |
# File 'lib/beerdb/cli/opts.rb', line 34 def world_data_path @world_data_path # NB: option has no default; return nil end |