scheduled_value 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03256b1fb2793955ad190fb8e3843c2284ebcbec
4
- data.tar.gz: 7de94668cee16c3ec62273d27e968cc0e3468aed
3
+ metadata.gz: bbff5447820539651750ba0579c4445f91c7fffb
4
+ data.tar.gz: b6c655b8c7c43d96217942679b797154171cf083
5
5
  SHA512:
6
- metadata.gz: 3c0ff1582c58ef50cd518efc791b5ce467359a3bb0adb0b4155801a8f0e91c471775e9bd34c9ff1fb7a72b391281824372701fb1299d995933f497c1628624fb
7
- data.tar.gz: 09b4918af958643332601f717edcd4a83a8ab7a841cf9e3b556f376aac264e030b1d4c8867f5f756408a3c40d55133901d7f4615290f6e7230f5a79aa65ace3c
6
+ metadata.gz: 7e6556576492abd7030c5eccf2b301a8b220fe130f477876380aa820d0e0ff91d4333830d3aa7546ae432b711ee3d9f976b9a35420912c2fde4b4891e9f612f1
7
+ data.tar.gz: 4314f98db721d158ad9b07bca53b49d26bee67361d815a673057b37092ab1b70ced27e0d01b4d7d12dc4a4554992fead33eaaf3bcc0de5c7ec2fa5a9b956bb3b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.1.0 - December 25, 2016
2
+
3
+ * Add `ScheduledValue::ScheduledValue#has_value_at?` method to reduce the need for exceptions-as-control-flow
4
+
1
5
  # 1.0.0 - December 24, 2016
2
6
 
3
7
  * Initial public release.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ScheduledValue
2
2
 
3
- ![Codeship test status](https://codeship.com/projects/165d5000-ac28-0134-2a75-16abc9b20ebe/status?branch=master)
3
+ [![Gem Version](https://badge.fury.io/rb/scheduled_value.svg)](https://badge.fury.io/rb/scheduled_value) ![Codeship test status](https://codeship.com/projects/165d5000-ac28-0134-2a75-16abc9b20ebe/status?branch=master)
4
4
 
5
5
  ScheduledValue provides a set of Ruby classes for representing values that change over time based on a schedule. One way to think about this is that for a regular variable, you could reasonably ask "what is its value?" For a ScheduledValue, you have to ask "what is its value *right now*?" Some examples of this might be:
6
6
 
@@ -64,6 +64,10 @@ module ScheduledValue
64
64
  value
65
65
  end
66
66
 
67
+ def has_value_at?(timestamp)
68
+ !!(timespan_containing(timestamp))
69
+ end
70
+
67
71
  def value_at(timestamp)
68
72
  timespan = timespan_containing(timestamp)
69
73
  raise "No timespan found for #{timestamp}" unless timespan
@@ -1,3 +1,3 @@
1
1
  module ScheduledValue
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scheduled_value
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Budin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-24 00:00:00.000000000 Z
11
+ date: 2016-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler