Class: Msewage::Importer::SourceTypes

Inherits:
Object
  • Object
show all
Defined in:
lib/msewage-importer/source_types.rb

Class Method Summary collapse

Class Method Details

.given_type_to_apis(type) ⇒ Object



4
5
6
# File 'lib/msewage-importer/source_types.rb', line 4

def given_type_to_apis(type)
  source_types[internal_types_to_msewages[type]]
end

.internal_types_to_msewagesObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/msewage-importer/source_types.rb', line 23

def internal_types_to_msewages
  {
    "open_defecation_site" => "Open defecation site",
    "toilet" => "Toilet",
    "latrine" => "Latrine",
    "septic_tank_cesspool" => "Septic tank/cesspool",
    "raw_sewage_outflow" => "Raw sewage outflow",
    "treatment_plant_outflow" => "Treatment plant outflow",
    "combined_sewer_outflow" => "Combined sewer outflow",
    "animal_manure" => "Animal manure",
    "industrial_waste_outflow" => "Industrial waste outflow",
    "open_sewage_canal_or_puddle" => "Open sewage canal or puddle"
  }
end

.source_typesObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/msewage-importer/source_types.rb', line 38

def source_types
  {
    "Open defecation site" => 0,
    "Toilet" => 1,
    "Latrine" => 2,
    "Septic tank/cesspool" => 3,
    "Raw sewage outflow" => 4,
    "Treatment plant outflow" => 5,
    "Combined sewer outflow" => 6,
    "Animal manure" => 7,
    "Industrial waste outflow" => 8,
    "Open sewage canal or puddle" => 9
  }
end

.types_supportedObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/msewage-importer/source_types.rb', line 8

def types_supported
  %w{
    animal_manure
    combined_sewer_outflow
    industrial_waste_outflow
    latrine
    open_defecation_site
    open_sewage_canal_or_puddle
    raw_sewage_outflow
    septic_tank_cesspool
    toilet
    treatment_plant_outflow
  }.sort
end