Class: WorldDb::BaseReader
- Inherits:
-
Object
- Object
- WorldDb::BaseReader
- Includes:
- LogUtils::Logging, Models, TextUtils::ValueHelper
- Defined in:
- lib/worlddb/readers/base.rb
Direct Known Subclasses
CityReader, CountryReader, LangReader, RegionReader, UsageReader
Instance Attribute Summary collapse
-
#include_path ⇒ Object
readonly
Returns the value of attribute include_path.
Instance Method Summary collapse
-
#initialize(include_path, opts = {}) ⇒ BaseReader
constructor
A new instance of BaseReader.
- #read(name, more_attribs = {}) ⇒ Object
- #skip_tags? ⇒ Boolean
- #strict? ⇒ Boolean
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 = 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_path ⇒ Object (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
20 |
# File 'lib/worlddb/readers/base.rb', line 20 def () == true; end |
#strict? ⇒ Boolean
21 |
# File 'lib/worlddb/readers/base.rb', line 21 def strict?() @strict == true; end |