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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfd1aaef7634b1e7600e7182b5e7b7d4995e57fa
4
- data.tar.gz: abfceb1ddc01aae9e6c412fdf1e4c45819631f36
3
+ metadata.gz: 46738cae56b29ee10c8d5b11764af669dd7cb7fd
4
+ data.tar.gz: 798bbd1e0d2ef8d25f2b7bbbec278328fa4106aa
5
5
  SHA512:
6
- metadata.gz: 6ca1e8254e6b61b32e404c3bbf49c745335a4311f266d668359645bad782acf7265025a341bfd5cd86f85e949974b87c523348dd16393a1f90429ab203af19a0
7
- data.tar.gz: 31baf0a4a3aab003ac013ef94148f7743699794b82da87e7e602188daeb4e96ed2b1c15753877944aeaabf0ecf6dc97bff58c560b5e6a203f3b5ee2a6c9859e0
6
+ metadata.gz: 68e290d67e861f705c5044c72b87eff373ec1f33c9965a8214a564197b887be1fa7483485aca3acb1ef2cd254159a7120de144b4b10c4750cca8b4c4637339cf
7
+ data.tar.gz: 86e8853d280b59974d2f8e29899ceda1f89738cbc84d92a4451c85e7490271fe9421b888c58618e3ca79450139b68dcb3acbb1f0725cc285bbd8de074755da98
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SensibleRoutes
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
@@ -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.0
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-01 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler