http-client-generator 0.1.23 → 0.1.24

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
  SHA256:
3
- metadata.gz: 8999f3c8370ae4dfa2c1444a6c4473fb042adf046c2908ab1b63bcccb92e97f8
4
- data.tar.gz: 59d12dc9c630ef3b7ce2b55c9447d4dcd4d8421e336524ae3de775895b0c635b
3
+ metadata.gz: f685763f801978967e103fadca27d8c086614b71e1b47ddf6929aead1bce8eb7
4
+ data.tar.gz: 116aafaf9d236c62c2aa5a627720f98c20b000cc20e51249e4c0e1e56b46fe97
5
5
  SHA512:
6
- metadata.gz: d2814174dddb430253358148deb4dcad1c9aeb14890eb0e9baf1699537b90ff6f67725de11227e95a2dd3843d1e1ebd492cdd20ee4650c3f6b3a4b771b9ad568
7
- data.tar.gz: 3ed009ce3680cbcf419edd8cf02812f5fd51a32f3aeb0931b7ee74efc51885b98c2205637849311b5267ed63e9854446f39c124c1017e2cec2c2d58a71ab2b1d
6
+ metadata.gz: 0a4ac673ad4adafa842e6877eb0ad989327801d71047981c95af0a021f9e9f6c2af8c1a2002fc9b14e276b89d696b45f4c5301b5edcc4acfb49417e1747712bc
7
+ data.tar.gz: 91a7be067d35bd83217715208884e80e773b22beb6da7ab3552dfd1f5ef48f232561f7482633743a1570fa454ce56ec547e1e0d4661c11fc269ca1cfacdbff2d
@@ -6,15 +6,24 @@ module HttpClientGenerator
6
6
  Plugs.register :validate_response, self
7
7
 
8
8
  module SchemaBuilder
9
- def schema_for(name, &block)
9
+ def self.included(base)
10
+ super
11
+
10
12
  require 'datacaster'
13
+ base.extend(self)
14
+ end
11
15
 
16
+ def schema_for(name, &block)
12
17
  @schemas ||= {}
13
18
  @schemas[name] = Datacaster.choosy_schema(&block)
14
19
 
15
20
  define_singleton_method(name) do |params|
16
21
  @schemas[name].(params)
17
22
  end
23
+
24
+ define_method(name) do |params|
25
+ @schemas[name].(params)
26
+ end
18
27
  end
19
28
  end
20
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HttpClientGenerator
4
- VERSION = '0.1.23'
4
+ VERSION = '0.1.24'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-client-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Egorov