Class: WorldDb::BaseReader

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging, Models, TextUtils::ValueHelper
Defined in:
lib/worlddb/readers/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(include_path, opts = {}) ⇒ BaseReader

Returns a new instance of BaseReader.



24
25
26
27
28
29
30
31
32
# File 'lib/worlddb/readers/base.rb', line 24

def initialize( include_path, opts = {} )
  
  @include_path = include_path
  
  ## option: do NOT generate/add any tags for countries/regions/cities
  @skip_tags =  opts[:skip_tags].present? ? true : false
  ## option: for now issue warning on update, that is, if key/record (country,region,city) already exists
  @strict    =  opts[:strict].present? ? true : false
end

Instance Attribute Details

#include_pathObject (readonly)

Returns the value of attribute include_path.



18
19
20
# File 'lib/worlddb/readers/base.rb', line 18

def include_path
  @include_path
end

Instance Method Details

#read(name, more_attribs = {}) ⇒ Object



35
36
37
# File 'lib/worlddb/readers/base.rb', line 35

def read( name, more_attribs={} )
  puts "error: overwrite in concrete reader class!!!"  ### overwrite!!!!
end

#skip_tags?Boolean

Returns:

  • (Boolean)


20
# File 'lib/worlddb/readers/base.rb', line 20

def skip_tags?()   @skip_tags == true;  end

#strict?Boolean

Returns:

  • (Boolean)


21
# File 'lib/worlddb/readers/base.rb', line 21

def strict?()      @strict == true;     end