roda-endpoints 0.3.1 → 0.3.2

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: d27908a4d47343597580a44f31b0b70ffe4f4989
4
- data.tar.gz: a3133effde967ed1f347b7f0d32193c3535d78c5
3
+ metadata.gz: f7372255aca1de1a82109d126d17cf936e6efc0e
4
+ data.tar.gz: 1ca0b7962cbf1a076da564075699a6798d4f63d2
5
5
  SHA512:
6
- metadata.gz: 48fc583f0aa6e9e8b2ffa32df5767f3cffde042f4f75aa3a8f1d11a98854e27c988c65fecf969ec7bbec6f8ccf2d646f7ae6d8bd4b78cf497eb44a9a4a0de98b
7
- data.tar.gz: 62f7f1602928453c90ad979f695940c041aefc1f507971d0972ac9e0d273a70ad10700a5379425101b9972f4ad467f0cbae59afd9a226297f0dba5b972bedd70
6
+ metadata.gz: 340dd36e447f1b258ba11600adff69f14a6d8d571111aafffc12b28601764b82af8100ca48b81f807166b9870c0455e08b0faee90ba4646e8ed27a19ae1ebc9d
7
+ data.tar.gz: 218a1625f5ec243816a6901c4da4584a0ef525be2d125932cbbb185980614836154f8766d5b38e2038debe1a6425f7f14a3e88942b76b2879e9eb53652b117c0
@@ -22,8 +22,6 @@ class Roda
22
22
 
23
23
  # @param [Symbol] key
24
24
  def define_attribute(key)
25
- self.attributes ||= superclass.attributes
26
- self.attributes += [key]
27
25
  attr_reader key
28
26
  end
29
27
 
@@ -32,7 +32,7 @@ class Roda
32
32
 
33
33
  # @return [Integer]
34
34
  def id
35
- @id ||= captures.first
35
+ instance_variable_defined?(:@id) ? @id : captures.first
36
36
  end
37
37
 
38
38
  # @return [ROM::Struct]
@@ -19,6 +19,10 @@ class Roda
19
19
  # @param [Integer] id
20
20
  # @return [ROM::Struct]
21
21
  def fetch(id)
22
+ if id.to_i < 1
23
+ raise ArgumentError,
24
+ "#{self.class}#fetch: invalid id provided: #{id.inspect}"
25
+ end
22
26
  root.fetch(id.to_i)
23
27
  end
24
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Roda
4
4
  module Endpoints
5
- VERSION = '0.3.1'
5
+ VERSION = '0.3.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-endpoints
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Semyonov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-02 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-container