Class: WorldDb::Opts

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

Instance Method Summary collapse

Instance Method Details

#data_pathObject



37
38
39
# File 'lib/worlddb/cli/opts.rb', line 37

def data_path
  @data_path || '.'
end

#data_path=(value) ⇒ Object



33
34
35
# File 'lib/worlddb/cli/opts.rb', line 33

def data_path=(value)
  @data_path = value
end

#db_nameObject



28
29
30
# File 'lib/worlddb/cli/opts.rb', line 28

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

#db_pathObject



24
25
26
# File 'lib/worlddb/cli/opts.rb', line 24

def db_path
  @db_path || '.'
end

#merge_gli_options!(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/worlddb/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) ⇒ Object

add: alias for debug ??



15
16
17
# File 'lib/worlddb/cli/opts.rb', line 15

def verbose=(boolean) # add: alias for debug ??
  @verbose = boolean
end

#verbose?Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/worlddb/cli/opts.rb', line 19

def verbose?
  return false if @verbose.nil? # default verbose/debug flag is false
  @verbose == true
end