roda-endpoints 0.3.5 → 0.3.6

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: 3d220ea238a9e1f5f64480a2c22bde112c58bfc5
4
- data.tar.gz: 8b964273d51c74a1a9dd446d95c317fc4e05ddce
3
+ metadata.gz: dcdcb92214ed6c54b90225a97a531707af3b8c94
4
+ data.tar.gz: c134751fc387fc238812df8502e8dc5ca28e3019
5
5
  SHA512:
6
- metadata.gz: 219c52fdfa1a3a8201b3e90e28c08cfa5c35be25437b428237893e5edf9720455f31ced6bfb7c48488ce2062d7bc68db606c8fa1170ef3278c1e368e26346039
7
- data.tar.gz: 6bbeeb8441720f459f2d477a60f9c24c9c73b1c2b894e05491a0ee520e536b31221b1b03a93d4c2a5662ec79dd2fdc0f4f468d66c500f4fffd83d956e87337c0
6
+ metadata.gz: 2a58ba1961562341dce2cd5558c68f4275e0ab6a39d27a1377e976fbb27e30b7e080ea877daa405c1d704528fa47248955ac01f3c88fd60c4e23e4cf497957db
7
+ data.tar.gz: 9397db9aa509b22a4f8d10f289bc3afd50b6a1f6121590d41b00e2d9b61d8991b1e7f8c952475d7e652e11f62bf922fa86546d31bc3d665096a0a8d241aa723b
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rake' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require 'pathname'
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require 'rubygems'
15
+ require 'bundler/setup'
16
+
17
+ load Gem.bin_path('rake', 'rake')
@@ -16,6 +16,12 @@ class Roda
16
16
  parent
17
17
  end
18
18
 
19
+ # @!method id
20
+ # @return [Integer]
21
+ id_proc do
22
+ instance_variable_defined?(:@id) ? @id : captures.last
23
+ end
24
+
19
25
  def_delegator :collection, :repository
20
26
  end
21
27
  end
@@ -26,9 +26,16 @@ class Roda
26
26
  # @return [Symbol]
27
27
  attr_reader :finder
28
28
 
29
- # @return [Integer]
29
+ def self.id_proc(method = nil, &block)
30
+ block = proc { public_send(method) } if method
31
+ @id_proc = block if block_given?
32
+ @id_proc
33
+ end
34
+
35
+ # @return [Integer?]
30
36
  def id
31
- instance_variable_defined?(:@id) ? @id : captures.first
37
+ return instance_eval(&self.class.id_proc) if self.class.id_proc
38
+ @id
32
39
  end
33
40
 
34
41
  # @return [ROM::Struct]
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Roda
4
4
  module Endpoints
5
- VERSION = '0.3.5'
5
+ VERSION = '0.3.6'
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.5
4
+ version: 0.3.6
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-03 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-container
@@ -327,6 +327,7 @@ files:
327
327
  - Rakefile
328
328
  - bin/bundle-audit
329
329
  - bin/console
330
+ - bin/rake
330
331
  - bin/rspec
331
332
  - bin/rubocop
332
333
  - bin/setup