metatron 0.2.0 → 0.2.1

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: e2595e703b422eadf0c748386541eae93f9b447d74e2bd70160a85dc14c7f59a
4
- data.tar.gz: 599adf4652b4e2bbf35f86f95c083f6e6e03780d44fa563c83ca714c90aa3004
3
+ metadata.gz: 668fa30d73c500f1a677d0424c480218b6438f75ff3fe1f369dbe81963d53dc3
4
+ data.tar.gz: 2d71d21bf0555ba052f34465d9b27c2dfe4f33c06e9383a74b225888c5b40b5f
5
5
  SHA512:
6
- metadata.gz: fd16efd8685097c4fdb321de668cecb60ac24c0dab98e1e97ab40590007d524dfa9b0ba644174786d659a0fc6bc1225b48b62cb0ae2a1224e1503ee8a6aa40c7
7
- data.tar.gz: d0255911256d4e233f300b5a82dbeba91feeba7819d920bdd2e2e3c505a02b1b7343fdfc8ec938912bc4f650491ddfdc51efc007f7e57e58527ecf0665b07adf
6
+ metadata.gz: d4859616cbe9ab91e9bd3d7595c44034ff80db1ebef4b7c08371b87d9cc32b4dc03b1a0afc0cca02b5dfe489f1c8015ebc4f42fa04d6cd6688f5795591fb8c20
7
+ data.tar.gz: ec29f2ea71f5692427e857b72b7636087f257e9ecb963eea7895d10c37cd6032c61b9ba2868c9f055076cd4e10ad0f0c8ce9a2431431c20ccc34a42c33755ce8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.2.0)
4
+ metatron (0.2.1)
5
5
  json (~> 2.6)
6
6
  puma (~> 6.3)
7
7
  sinatra (~> 2.2)
@@ -18,7 +18,7 @@ module Metatron
18
18
  @name = name
19
19
  @label_namespace = self.class.label_namespace
20
20
  @api_version = "v1"
21
- @kind = self.class.name.split("::").last
21
+ @kind = find_kind
22
22
  run_initializers
23
23
  end
24
24
 
@@ -38,5 +38,15 @@ module Metatron
38
38
  def run_initializers
39
39
  self.class.initializers.each { |initializer| send(initializer.to_sym) }
40
40
  end
41
+
42
+ def find_kind
43
+ return self.class.name.split("::").last if metatron_template?
44
+
45
+ self.class.ancestors.find { |klass| metatron_template?(klass) }.name.split("::").last
46
+ end
47
+
48
+ def metatron_template?(klass = self)
49
+ klass.name.include?("Metatron::Templates") && !klass.name.include?("Concerns")
50
+ end
41
51
  end
42
52
  end
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  2, # minor
7
- 0 # patch
7
+ 1 # patch
8
8
  ].join(".")
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy