Building the 411 for air quality in the United States: a texting platform accessible to all, that provides actionable local information to protect your and your community.
Strategy pattern: the ConversionStrategy determines the actual pm25 and is swappable.
Delegation: we delegate determining the actual pm25 from the Client object to the Zipcode and Readings objects, from the Zipcode object to the Readings object, and from the Readings object to the ConversionStrategy object.
Dependency injection: we inject the correct strategy into methods like Zipcode.get_current_aqi(conversion_strategy).
Anyway.
There aren't a lot of tests here, which is a bit unfortunate. But I sort of just want to merge this down and let people start playing with it. We should all set our Hazebot alerting to frequent (maybe once an hour instead of the default once every six hours) and set the threshold to Good instead Medium. And then finally select the US EPA conversion strategy.
This PR is a great example (if I may say so) of the strategy pattern, of delegation and of dependency injection:
ConversionStrategy
determines the actual pm25 and is swappable.Client
object to theZipcode
andReadings
objects, from theZipcode
object to theReadings
object, and from theReadings
object to theConversionStrategy
object.Zipcode.get_current_aqi(conversion_strategy)
.Anyway.
There aren't a lot of tests here, which is a bit unfortunate. But I sort of just want to merge this down and let people start playing with it. We should all set our Hazebot alerting to frequent (maybe once an hour instead of the default once every six hours) and set the threshold to Good instead Medium. And then finally select the US EPA conversion strategy.