kix 1.0.0 → 1.0.2

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: 73cbb48e3bf3d401859dc5e0bbd21ad01c46a903688c521ae329b34046ac0ad4
4
- data.tar.gz: '09ad8c04fcf1a91d335383f9c8f17106e844acc1ccaea134e0f79e719f936a00'
3
+ metadata.gz: acb0de22011753bb7dc4b0b3d10e6433cb43f1e7d765638984eeb334e60ac094
4
+ data.tar.gz: f3d1e4a7deb60df633acd8dd54fae43a16e787b360c14794d362d453c8d21517
5
5
  SHA512:
6
- metadata.gz: 42338e47cae7cc16e94d77fbb08adda60cfc3a7ca977eab03e66657b4fe6d32bff7ee6d5a2ec30e303851f7101f7e05dee3415b600b0bf2627e4c67fe6f32f1b
7
- data.tar.gz: 226f94242b9a68f53aecebe0fe5afe16abdda44ad8110573c20ee2d735a3ccedea81223cf1a8c1c990f1e3b1f9dae18d9317967fb09e433397742ee93eee1757
6
+ metadata.gz: 16beda7f9a8ca0ddb7bec6dab842f0a34656dccc7b8f1cef897e82ed6115a3bcd6df2d867b861fadc6f72a5dd605d18271f9922770bd6a9bf07f2fe9060d3e91
7
+ data.tar.gz: 23721fa5db13808907b9fb28a3845821a901e3a8e29e5fbeb5bcc9e49f794434ddcd0efafde405f6beacd2460c85d7269038ff6fa4a29a81db527c7908d0bf92
data/Gemfile.lock CHANGED
@@ -1,27 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kix (0.1.0)
4
+ kix (1.0.1)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.1.3.1)
10
+ activesupport (7.0.4)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
14
14
  tzinfo (~> 2.0)
15
- zeitwerk (~> 2.3)
16
15
  ast (2.4.2)
17
16
  coderay (1.1.3)
18
- concurrent-ruby (1.1.8)
17
+ concurrent-ruby (1.1.10)
19
18
  diff-lcs (1.4.4)
20
19
  docile (1.3.5)
21
- i18n (1.8.10)
20
+ i18n (1.12.0)
22
21
  concurrent-ruby (~> 1.0)
23
22
  method_source (1.0.0)
24
- minitest (5.14.4)
23
+ minitest (5.16.3)
25
24
  parallel (1.20.1)
26
25
  parser (3.0.1.0)
27
26
  ast (~> 2.4.1)
@@ -69,10 +68,9 @@ GEM
69
68
  standard (1.0.5)
70
69
  rubocop (= 1.12.1)
71
70
  rubocop-performance (= 1.10.1)
72
- tzinfo (2.0.4)
71
+ tzinfo (2.0.5)
73
72
  concurrent-ruby (~> 1.0)
74
73
  unicode-display_width (2.0.0)
75
- zeitwerk (2.4.2)
76
74
 
77
75
  PLATFORMS
78
76
  x86_64-linux
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Kix
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kix`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ A gem to serialize objects using a similar API to active_model_serializers.
4
+ It technically doesn't require that you use Rails, but it does leverage some
5
+ Active Support modules so it's geared towards rails apps.
6
6
 
7
7
  ## Installation
8
8
 
@@ -13,7 +13,15 @@ module Kix
13
13
  class_methods do
14
14
  def inherited(klass)
15
15
  super
16
+ # Use the parent serializer by default
16
17
  klass.serializer(serializer)
18
+
19
+ # See if there is a class specific serializer
20
+ begin
21
+ klass.serializer("#{klass}Serializer".constantize)
22
+ rescue NameError
23
+ klass.serializer(serializer)
24
+ end
17
25
  end
18
26
 
19
27
  def serializer(klass = nil)
@@ -25,6 +25,10 @@ module Kix
25
25
  end
26
26
 
27
27
  class << self
28
+ def inherited(subclass)
29
+ subclass.attributes(*@defined_attributes)
30
+ end
31
+
28
32
  def attributes(*attrs)
29
33
  attrs.each { |attr| defined_attributes.push(attr.to_s) }
30
34
  end
data/lib/kix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kix
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Thomas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-21 00:00:00.000000000 Z
11
+ date: 2022-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport