Class: Namey::Parser
- Inherits:
-
Object
- Object
- Namey::Parser
- Defined in:
- lib/namey/parser.rb
Overview
parse the census bureau data files and load into our datasource
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(dbname = Namey.db_path) ⇒ Parser
constructor
initialize the parser dbname - Sequel style db URI ex: ‘sqlite://foo.db’.
-
#load_female_names(src) ⇒ Object
load in the female name list.
-
#load_male_names(src) ⇒ Object
load in the male name list.
-
#load_surnames(src) ⇒ Object
load in the surname list.
Constructor Details
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
11 12 13 |
# File 'lib/namey/parser.rb', line 11 def db @db end |
Instance Method Details
#load_female_names(src) ⇒ Object
load in the female name list
31 32 33 |
# File 'lib/namey/parser.rb', line 31 def load_female_names(src) parse_file(src, "female") end |
#load_male_names(src) ⇒ Object
load in the male name list
24 25 26 |
# File 'lib/namey/parser.rb', line 24 def load_male_names(src) parse_file(src, "male") end |
#load_surnames(src) ⇒ Object
load in the surname list
38 39 40 |
# File 'lib/namey/parser.rb', line 38 def load_surnames(src) parse_file(src, "surname") end |