interval_notation 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48b23bd79ddea327e0d8da11597e387ef1df690a
4
- data.tar.gz: 6911357f55445730fcf793991412b74830ac510f
3
+ metadata.gz: 5959995f95355a82acf74a537288c6625466975d
4
+ data.tar.gz: b621dd95df2c290949cd919bc4e210444ff120f2
5
5
  SHA512:
6
- metadata.gz: ca29426c646771b4cc577d64d2ce15d5856daf22f84bba9aa8b2be2912f047881041d8ef92926bb31989e6101de8f8935f6a1b13bd3dbedd9a94478b1cb57100
7
- data.tar.gz: 1c7571f48cf241d8e8876070e1a9417421cb145b1aa3bf1e9289d90bb7de8b5fb27bf1f3af9163e9675fd45fe6d4307e9b34095984fed8c6d9bf64baf843ce9f
6
+ metadata.gz: 6e4acb6c0fc3834c1b4ebd915356f2169212a53ff8fa4b0f6f3868f1e2555fa589433cf97a984b7dae89eb738ee1dc96453a3872b82ae33875290900834f7899
7
+ data.tar.gz: 6fbc038e920099bde55ae847fa48b77ca9a1669c9bfa14507e3fa240ab73a6ecb52f7b9b8e846cd19397efc8976a7eccec7b67d31e846d40086dea64c377adef
@@ -73,6 +73,7 @@ module IntervalNotation
73
73
  [ BoundaryPoint.new(from, false, true, interval_index, true),
74
74
  BoundaryPoint.new(to, false, false, interval_index, true) ]
75
75
  end
76
+ def integer_points; (from + 1).floor .. (to - 1).ceil; end
76
77
  end
77
78
 
78
79
  class OpenClosedInterval
@@ -105,6 +106,7 @@ module IntervalNotation
105
106
  [ BoundaryPoint.new(from, false, true, interval_index, true),
106
107
  BoundaryPoint.new(to, true, false, interval_index, true) ]
107
108
  end
109
+ def integer_points; (from + 1).floor .. to.floor; end
108
110
  end
109
111
 
110
112
  class ClosedOpenInterval
@@ -137,6 +139,7 @@ module IntervalNotation
137
139
  [ BoundaryPoint.new(from, true, true, interval_index, true),
138
140
  BoundaryPoint.new(to, false, false, interval_index, true) ]
139
141
  end
142
+ def integer_points; from.ceil .. (to - 1).ceil; end
140
143
  end
141
144
 
142
145
  class ClosedClosedInterval
@@ -168,6 +171,7 @@ module IntervalNotation
168
171
  [ BoundaryPoint.new(from, true, true, interval_index, true),
169
172
  BoundaryPoint.new(to, true, false, interval_index, true) ]
170
173
  end
174
+ def integer_points; from.ceil .. to.floor; end
171
175
  end
172
176
 
173
177
  class Point
@@ -206,6 +210,7 @@ module IntervalNotation
206
210
  def interval_boundaries(interval_index)
207
211
  BoundaryPoint.new(from, true, nil, interval_index, false)
208
212
  end
213
+ def integer_points; value..value; end
209
214
 
210
215
  # include position and its vicinity (point can't include vicinity of a position)
211
216
  def deep_include_position?(pos)
@@ -1,3 +1,3 @@
1
1
  module IntervalNotation
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interval_notation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Vorontsov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler