Class: Gribr::Degrib::Message
- Inherits:
-
Object
- Object
- Gribr::Degrib::Message
- Defined in:
- lib/gribr/degrib/message.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#inventory_record ⇒ Object
readonly
Returns the value of attribute inventory_record.
Instance Method Summary collapse
-
#initialize(file, inventory_record) ⇒ Message
constructor
A new instance of Message.
-
#probe(latitude, longitude, options = { }, &block) ⇒ Object
Probe the grib message at the given location and return/yield the records.
Constructor Details
#initialize(file, inventory_record) ⇒ Message
Returns a new instance of Message.
8 9 10 |
# File 'lib/gribr/degrib/message.rb', line 8 def initialize(file, inventory_record) @file, @inventory_record = file, inventory_record end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/gribr/degrib/message.rb', line 6 def file @file end |
#inventory_record ⇒ Object (readonly)
Returns the value of attribute inventory_record.
6 7 8 |
# File 'lib/gribr/degrib/message.rb', line 6 def inventory_record @inventory_record end |
Instance Method Details
#probe(latitude, longitude, options = { }, &block) ⇒ Object
Probe the grib message at the given location and return/yield the records.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/gribr/degrib/message.rb', line 14 def probe(latitude, longitude, = { }, &block) records = Array.new file.probe(latitude, longitude, ) do |record| # if record.element.downcase == inventory_record.element.downcase yield(record) if block_given? records << record # end end records end |