Method: Osm::Event.get
- Defined in:
- lib/osm/event.rb
.get(api, section, event_id, options = {}) ⇒ Osm::Event?
Get an event
189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/osm/event.rb', line 189 def self.get(api, section, event_id, ={}) require_ability_to(api, :read, :events, section, ) section_id = section.to_i event_id = event_id.to_i cache_key = ['event', event_id] if ![:no_cache] && cache_exist?(api, cache_key) return cache_read(api, cache_key) end event_data = api.perform_query("events.php?action=getEvent§ionid=#{section_id}&eventid=#{event_id}") return self.new_event_from_data(event_data) end |