-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
335f812
commit dbbd6d7
Showing
14 changed files
with
370 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module Stations | ||
class Humidity < Model | ||
property 'average' | ||
property 'weight' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module Stations | ||
class Measurement < Model | ||
property 'station_id' # The internal ID of the station | ||
property 'type' # Type of the aggregated data - minute, hour or day. Specifies the letters m, h or d respectively | ||
property 'date' # Time of measurement | ||
property 'temp' | ||
property 'humidity' | ||
property 'wind' | ||
property 'precipitation' | ||
property 'pressure' | ||
|
||
def initialize(args = nil, options = {}) | ||
super args, options | ||
|
||
self.temp = OpenWeather::Models::Stations::Temp.new(temp, options) if temp | ||
self.humidity = OpenWeather::Models::Stations::Humidity.new(humidity, options) if humidity | ||
self.pressure = OpenWeather::Models::Stations::Pressure.new(pressure, options) if pressure | ||
self.precipitation = OpenWeather::Models::Stations::Precipitation.new(precipitation, options) if precipitation | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module Stations | ||
class Precipitation < Model | ||
property 'rain' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module Stations | ||
class Pressure < Model | ||
property 'min' | ||
property 'max' | ||
property 'average' | ||
property 'weight' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module Stations | ||
class Temp < Model | ||
temperature_property 'min' | ||
temperature_property 'max' | ||
temperature_property 'average' | ||
property 'weight' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
spec/fixtures/open_weather/stations/create_measurement_failed_with_invalid_station.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
spec/fixtures/open_weather/stations/create_measurement_success.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
spec/fixtures/open_weather/stations/get_measurement_success.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.