Sha256: f0c1e67d2486247efd0e53c534b7fc088ee3c083dde62e4c97a16622c5c4ce7c

Contents?: true

Size: 557 Bytes

Versions: 2

Compression:

Stored size: 557 Bytes

Contents

class Stormglass::AlternateValues::Degrees

  POINTS = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW']

  def self.perform(subvalues)
    inject_compass_points(subvalues)
  end

  private

  def self.inject_compass_points(subvalues)
    compass_point = Geocoder::Calculations.compass_point(subvalues.first[:value], POINTS)
    subvalues << {unit_type: 'compass', value: compass_point, unit: '', description: subvalues.first[:description], unit_description: 'From 16 shorthand compass points'}
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stormglass-0.2.0 lib/stormglass/alternate_values/degrees.rb
stormglass-0.1.1 lib/stormglass/alternate_values/degrees.rb