Class: OpenWeather::Models::Station

Inherits:
Model
  • Object
show all
Defined in:
lib/open_weather/models/station.rb

Instance Attribute Summary

Attributes inherited from Model

#options

Instance Method Summary collapse

Methods inherited from Model

#initialize, #units

Constructor Details

This class inherits a constructor from OpenWeather::Models::Model

Instance Method Details

#delete!Object



30
31
32
# File 'lib/open_weather/models/station.rb', line 30

def delete!
  OpenWeather::Client.new.delete_station(id)
end

#register!Object



16
17
18
19
20
21
# File 'lib/open_weather/models/station.rb', line 16

def register!
  data = OpenWeather::Client.new.register_station(to_h)
  update_attributes!(data)

  self
end

#update!(attributes) ⇒ Object



23
24
25
26
27
28
# File 'lib/open_weather/models/station.rb', line 23

def update!(attributes)
  data = OpenWeather::Client.new.update_station(id, attributes)
  update_attributes!(data)

  self
end