Sha256: 6270aae320db7dd50e499d26701d5487135106295ecd88221ccfe8c4a550e4dc

Contents?: true

Size: 605 Bytes

Versions: 2

Compression:

Stored size: 605 Bytes

Contents

# encoding: utf-8

module SportDb

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
  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 || 'sport.db'
  end
end # class Opts

end # module SportDb

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sportdb-2.1.0 lib/sportdb/cli/opts.rb
sportdb-2.0.0 lib/sportdb/cli/opts.rb