Class: DWML::ParameterExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/dwml/parameter_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element, location, time_layouts) ⇒ ParameterExtractor

Returns a new instance of ParameterExtractor.


5
6
7
8
9
10
11
12
13
14
# File 'lib/dwml/parameter_extractor.rb', line 5

def initialize(element, location, time_layouts)
  @element      = element
  @location     = location
  @time_layouts = time_layouts

  @output = {
    :latitude  => location.latitude,
    :longitude => location.longitude
  }
end

Instance Attribute Details

#elementObject (readonly)

Returns the value of attribute element


3
4
5
# File 'lib/dwml/parameter_extractor.rb', line 3

def element
  @element
end

#locationObject (readonly)

Returns the value of attribute location


3
4
5
# File 'lib/dwml/parameter_extractor.rb', line 3

def location
  @location
end

#outputObject (readonly)

Returns the value of attribute output


3
4
5
# File 'lib/dwml/parameter_extractor.rb', line 3

def output
  @output
end

#time_layoutsObject (readonly)

Returns the value of attribute time_layouts


3
4
5
# File 'lib/dwml/parameter_extractor.rb', line 3

def time_layouts
  @time_layouts
end

Instance Method Details

#processObject


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dwml/parameter_extractor.rb', line 16

def process
  extract_temperatures
  extract_precipitation
  extract_wind_speed
  extract_wind_direction
  extract_cloud_cover
  extract_probability_of_precipitation
  extract_fire_weather
  extract_convective_hazard
  extract_climate_anomaly
  extract_humidity
  extract_weather
  extract_conditions_icons
  extract_hazards
  extract_water_state

  output
end