Class: BeerDb::Opts

Inherits:
Object
  • Object
show all
Defined in:
lib/beerdb/cli/opts.rb

Instance Method Summary collapse

Instance Method Details

#data_pathObject



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_nameObject



21
22
23
# File 'lib/beerdb/cli/opts.rb', line 21

def db_name
  @db_name || 'beer.db'
end

#db_pathObject



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 merge_commander_options!( options = {} )
  @db_path   = options[:dbpath]  if options[:dbpath].present?
  @db_name   = options[:dbname]  if options[:dbname].present?

  @data_path = options[:include] if options[:include].present?
  
  @world_data_path = options[:worldinclude] if options[:worldinclude].present? 
end

#world_data_pathObject



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