sensible_routes 0.1.0 → 0.1.1
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 +4 -4
- data/lib/sensible_routes/version.rb +1 -1
- data/lib/sensible_routes.rb +19 -0
- 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: 46738cae56b29ee10c8d5b11764af669dd7cb7fd
|
4
|
+
data.tar.gz: 798bbd1e0d2ef8d25f2b7bbbec278328fa4106aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e290d67e861f705c5044c72b87eff373ec1f33c9965a8214a564197b887be1fa7483485aca3acb1ef2cd254159a7120de144b4b10c4750cca8b4c4637339cf
|
7
|
+
data.tar.gz: 86e8853d280b59974d2f8e29899ceda1f89738cbc84d92a4451c85e7490271fe9421b888c58618e3ca79450139b68dcb3acbb1f0725cc285bbd8de074755da98
|
data/lib/sensible_routes.rb
CHANGED
@@ -91,6 +91,25 @@ class SensibleRouteCollection
|
|
91
91
|
@routes
|
92
92
|
end
|
93
93
|
|
94
|
+
# Get a route at a particular index from the collection.
|
95
|
+
# @param idx the index from which to return an element
|
96
|
+
# @return SensibleRoute
|
97
|
+
def [](idx)
|
98
|
+
@routes[idx]
|
99
|
+
end
|
100
|
+
|
101
|
+
# Get the first route in the collection.
|
102
|
+
# @return SensibleRoute
|
103
|
+
def first
|
104
|
+
@routes[0]
|
105
|
+
end
|
106
|
+
|
107
|
+
# Get the last route in the collection.
|
108
|
+
# @return SensibleRoute
|
109
|
+
def last
|
110
|
+
@routes[-1]
|
111
|
+
end
|
112
|
+
|
94
113
|
# Filter the collection to only those entries that match the given block.
|
95
114
|
# @param &block a block that returns true to retain an element, or false to reject it
|
96
115
|
# @return SensibleRouteCollection
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensible_routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArtOfCode-
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|