interval_notation 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/interval_notation/basic_intervals.rb +5 -0
- data/lib/interval_notation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5959995f95355a82acf74a537288c6625466975d
|
4
|
+
data.tar.gz: b621dd95df2c290949cd919bc4e210444ff120f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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.
|
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-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|