Sha256: 3980cfcf7d8ef5ccec8e67bf4d201653daa3f49f8146a32142ef00470c5423e2

Contents?: true

Size: 343 Bytes

Versions: 2

Compression:

Stored size: 343 Bytes

Contents

class Stormglass::AlternateValues::Kilometers

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

  private

  def self.inject_miles(subvalues)
    subvalues << {unit_type: 'miles', unit: 'mi', value: (subvalues.first[:value] / 1.609344).round(2), description: subvalues.first[:description], unit_description: 'miles'}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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