Sha256: 45765271f26115afdd24447f950a7ae970cbb9d5f6df3c7b53d96633b94e0693
Contents?: true
Size: 935 Bytes
Versions: 18
Compression:
Stored size: 935 Bytes
Contents
module BeerDb class Opts 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? @world_data_path = options[:worldinclude] if options[:worldinclude].present? end def verbose=(boolean) # add: alias for debug ?? @verbose = boolean end def verbose? return false if @verbose.nil? # default verbose/debug flag is false @verbose == true end def db_path @db_path || '.' end def db_name @db_name || 'beer.db' end def data_path=(value) @data_path = value end def data_path @data_path || '.' end def world_data_path @world_data_path # NB: option has no default; return nil end end # class Opts end # module BeerDb
Version data entries
18 entries across 18 versions & 1 rubygems