sti_type_customizable 0.3.0 → 0.4.0

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: a9c1bc719744e9fbc3b543e02ca3efe920074f46
4
- data.tar.gz: 0cb6f86687217180cd14efe8df973fbc181f185e
3
+ metadata.gz: 35e3700e16d39906db475a0ef2adaf33f4fc3f7e
4
+ data.tar.gz: f3303e2f8751c15c05a6244ebe05da77f0b63ba3
5
5
  SHA512:
6
- metadata.gz: 7bb8abcaad696553ff80577f8ab48658e3f380de87fffa1d55c0945fda89811d7fb598029fdda531cf6d9203eda1b99ae47ad540b200f2d238355dd74523cb9b
7
- data.tar.gz: 3d2bb3d6e21888fbf17117de17d06ec5a99cc540f164413edddee0c1467751278c907f3f6480b0e52e9aab7c68175e1a34c0f033b692281605f172db12134ee8
6
+ metadata.gz: 69b91dc39393b64629d644450956ee7a6bb019054aa9b02b6446db2fbf86e73f802df5fec81cc97dceba283402526fc5149280b45c89434f04ab43d736580a7e
7
+ data.tar.gz: 67e5d2fc2ebc65d80448a9ad86614d695475dc08df30478decec479f9cf3f2121972f866b89277806469844958553b461b026d7bdf28cf7f1de3456798bf22a2
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module StiTypeCustomizable
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
@@ -7,11 +7,12 @@ module StiTypeCustomizable
7
7
 
8
8
  included do
9
9
  class_attribute :sti_type_value
10
+ class_attribute :sti_entities
10
11
  end
11
12
 
12
13
  class_methods do
13
14
  def sti_child_classes(classes)
14
- @sti_entities ||= begin
15
+ self::sti_entities ||= begin
15
16
  {}.tap do |entities|
16
17
  classes.each do |klass|
17
18
  raise NotImplementedError unless klass.include? StiTypeCustomizable
@@ -23,11 +24,11 @@ module StiTypeCustomizable
23
24
  end
24
25
 
25
26
  def find_sti_class(type)
26
- @sti_entities[type] || self
27
+ self::sti_entities[type] || self
27
28
  end
28
29
 
29
30
  def sti_name
30
- @sti_entities.invert[self] || self::sti_type_value
31
+ self::sti_entities.invert[self] || self::sti_type_value
31
32
  end
32
33
  end
33
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sti_type_customizable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Ooishi