Class: Relaton::Ogc::Hit
Instance Attribute Summary
Attributes inherited from Core::Hit
Instance Method Summary collapse
Methods inherited from Core::Hit
#fetched?, #initialize, #inspect, #to_s, #to_xml
Constructor Details
This class inherits a constructor from Relaton::Core::Hit
Instance Method Details
#item ⇒ Relaton::Ogc::ItemData
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/relaton/ogc/hit.rb', line 5 def item @item ||= begin url = "#{HitCollection::ENDPOINT}#{hit[:file]}" resp = Faraday.get(url) { |req| req..timeout = 10 } return unless resp.status == 200 item = Item.from_yaml resp.body item.fetched = Date.today.to_s item end end |