Class: Metar::Raw::Data

Inherits:
Base
  • Object
show all
Defined in:
lib/metar/raw.rb

Overview

Use this class when you have a METAR string and the date of reading

Instance Attribute Summary

Attributes inherited from Base

#metar, #time

Instance Method Summary collapse

Constructor Details

#initialize(metar, time = nil) ⇒ Data

Returns a new instance of Data.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/metar/raw.rb', line 18

def initialize(metar, time = nil)
  if time.nil?
    warn <<-WARNING
    Using Metar::Raw::Data without a time parameter is deprecated.
    Please supply the reading time as the second parameter.
    WARNING
    time = Time.now
  end

  @metar = metar
  @time = time
end