easy_params 0.6.1 → 0.6.3

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
  SHA256:
3
- metadata.gz: a707b8082dc9c58012a4b8f93c93d2c8543b3ee85d96f64d972b9a074b3bed29
4
- data.tar.gz: 2d0a8eeea15d0418f91c4fb48e128d1f965db24773a81a9ac4f23d6c2b01500e
3
+ metadata.gz: b79487643ec7868875e3ea3f6322124cb48a7799dccdca9d4fda8932c428e828
4
+ data.tar.gz: 621dd04fcab541eff277218fb50295427dacc946702019ee9fc7c4e1669d47f8
5
5
  SHA512:
6
- metadata.gz: 941a6c062c86638aa540eba6ac2fc697ba9177b7521c344bed4ae71b88747b5419c1c8b15cf44da9d5dea5098bf6a6de910125173bdfa75cb4838f353f28caec
7
- data.tar.gz: 7a07ba572c6fe6890368b7b1b0458cf934ee07953e4bd84a60728945c5f852d2a8206fe0e6cf83b70be343dda5683927b9e29d49292cb8181461ffa567611cb9
6
+ metadata.gz: bef6ae6e354a0296877ad15989c31797c1774c4ffb2285b6817e8a0b039d420b51f4e36429be5d839690b1d5f77d16fc990406f1508e87924eb6234d96b34487
7
+ data.tar.gz: 42853d376d3bf78637ebbac6501324592f4220123e91174cd92d406548be2f9b90f9f78268159d6f4540b8d5a19094b5be5952193eb8baab3b01ad54a9483255
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_params (0.6.1)
4
+ easy_params (0.6.3)
5
5
  activemodel (>= 3.2)
6
6
 
7
7
  GEM
@@ -16,6 +16,11 @@ module EasyParams
16
16
  end
17
17
 
18
18
  class << self
19
+ def inherited(subclass)
20
+ super
21
+ subclass.clone_schema(self)
22
+ end
23
+
19
24
  def name
20
25
  'EasyParams::Base'
21
26
  end
@@ -59,6 +64,10 @@ module EasyParams
59
64
  attribute(param_name, type)
60
65
  end
61
66
 
67
+ def clone_schema(parent)
68
+ @schema = parent.schema.dup
69
+ end
70
+
62
71
  private
63
72
 
64
73
  def customize_type(type, default, &normalize)
@@ -33,6 +33,10 @@ module EasyParams
33
33
  def each(&block)
34
34
  @default.each(&block)
35
35
  end
36
+
37
+ def [](index)
38
+ @default[index]
39
+ end
36
40
  end
37
41
 
38
42
  # base interface for array of structs type
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyParams
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_params
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrii Baran