meteorologist 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/meteorologist.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdc9287bd908e81f0bf5fcc5b216c90e43f1b326
4
- data.tar.gz: 10a993574f9a18d5393207fcc25a9bc5053ede1a
3
+ metadata.gz: 355054fbfa54484ee183d31e9fb7b803ae5c43b5
4
+ data.tar.gz: bc9d3fec98955d5cb4f264d5b8788c942cadbc48
5
5
  SHA512:
6
- metadata.gz: 4f47dda6f63c8bb7ebc07bd13d8d412f7cd11f107264765c389a994914746a4b2dc5f0cb147743b5ed324a1895a31161084a0822841b0623251ad8a43c824968
7
- data.tar.gz: 1961e140c85b91708950abe9e93f533b8e636a69cdd1b020dacacf56d3237fa698a00b1f58a3db67a6ee9abd3a021384cc1f8adcbe4dca0f78003862d4c44d1a
6
+ metadata.gz: 5c98fa38de275ac6d28ad4da953af647aa241afea481b1420c129da64625f5b25eb49785168386cba023042f949081d81aa7872c9b3dbd478f179d2677d0c5db
7
+ data.tar.gz: 06cd3f67d6587753506ee554ba1b8bf3acae33b7e5a76a519e0c018afaf08457c341e6e75e8841745fb60dbf88e8112d166ef7e10d496fee1bc827d4640a69e6
data/lib/meteorologist.rb CHANGED
@@ -5,19 +5,19 @@ class Meteorologist
5
5
  validate_environment
6
6
 
7
7
  @location = location
8
- #todo allow forecast at a given time
9
- #@time = options.fetch(:forecast_time) { Time.now }
10
8
  @forecaster_class = options.fetch(:forecaster) { Forecaster }
11
9
  @navigator_class = options.fetch(:navigator) { Navigator }
12
- @units = options.fetch(:units) { 'si' }
10
+ @moon_info_class = options.fetch(:moon_info) { MoonInfo }
11
+ @forecast_time = options.fetch(:forecast_time) { Time.now }
12
+ @units = options.fetch(:units) { 'si' } # or 'us' for Imperial units
13
13
  end
14
14
 
15
15
  def forecast
16
- @forecast ||= @forecaster_class.new(coordinates, units)
16
+ @forecast ||= @forecaster_class.new(coordinates, units, forecast_time)
17
17
  end
18
18
 
19
19
  def moon
20
- #todo add moon_info service from tarot_backend
20
+ @moon ||= @moon_info_class.new(forecast.moon_phase)
21
21
  end
22
22
 
23
23
  def location_name
@@ -25,7 +25,7 @@ class Meteorologist
25
25
  end
26
26
 
27
27
  private
28
- attr_reader :location, :units
28
+ attr_reader :location, :forecast_time, :units
29
29
 
30
30
  def coordinates
31
31
  navigator.coordinates
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meteorologist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dax