class BeerDb::Opts

Public Instance Methods

data_path() click to toggle source
# File lib/beerdb/cli/opts.rb, line 38
def data_path
  @data_path || '.'
end
data_path=(value) click to toggle source
# File lib/beerdb/cli/opts.rb, line 34
def data_path=(value)
  @data_path = value
end
db_name() click to toggle source
# File lib/beerdb/cli/opts.rb, line 29
def db_name
  @db_name || 'beer.db'
end
db_path() click to toggle source
# File lib/beerdb/cli/opts.rb, line 25
def db_path
  @db_path || '.'
end
merge_gli_options!( options = {} ) click to toggle source
# File lib/beerdb/cli/opts.rb, line 5
def merge_gli_options!( options = {} )
  @db_path   = options[:dbpath]  if options[:dbpath].present?
  @db_name   = options[:dbname]  if options[:dbname].present?

  @verbose = true     if options[:verbose] == true

  @data_path       = options[:include]      if options[:include].present?
end
verbose=(boolean) click to toggle source
# File lib/beerdb/cli/opts.rb, line 15
def verbose=(boolean)   # add: alias for debug ??
  @verbose = boolean
end
verbose?() click to toggle source
# File lib/beerdb/cli/opts.rb, line 19
def verbose?
  return false if @verbose.nil?   # default verbose/debug flag is false
  @verbose == true
end