active_method 1.4.0 → 1.5.0

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: 4fab4e210742187e5e4a9beec876bd7fda51e8c35f5ead5727dc0ca70312f11b
4
- data.tar.gz: fbcbb425512417164afb2dcf7b109a08285ba703cecb19eb8f65db013f2f08b9
3
+ metadata.gz: 8c0688ad78d8a0b27bd65cb414eb2815684a86e415a50de9858f1e9a0bccaa91
4
+ data.tar.gz: f4d248efb0782cf91cd1476537dbc31bf3b43373813bae9dd25444651a8d9dae
5
5
  SHA512:
6
- metadata.gz: a1195ca092a70e1f51147b7d5db82910e46af2ae2a4923800012a6f26d17fbd8d01e2c0f342ef79a2d44255f2524d02d5557a55c964633648358d466af276967
7
- data.tar.gz: bd67e7208be9c451d1e1d72e0d5d85be81ae49143093d9325c36218136226481832d45e1cbd621c9ad4d4269349d16ff211a4254065d99c7edd7d802abd2c746
6
+ metadata.gz: 9a4aaea9111161b1a672ee7eecced37c7654c0ec684f82f3b4469df8577dd050fe1066a7559561094d9faf62daa8c53e3fb19a43f54645bca4667a5d849edc90
7
+ data.tar.gz: adeb5ec18322b51f25bfd998859329b246cf5d2cc06818ab93e09e040dd9ddf10959ec72be56aa6f9452eb61c605c19d08af95d37da1a31efc4aa94aec9167d0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.5.0] - 2024-12-18
4
+
5
+ - Support inheritance
6
+
3
7
  ## [1.4.0] - 2024-06-23
4
8
 
5
9
  - Support customize method owner name
@@ -22,21 +22,17 @@ module ActiveMethod
22
22
  end
23
23
 
24
24
  def arguments
25
- class_variable_get(:@@arguments)
25
+ @arguments ||= {}
26
26
  end
27
27
 
28
28
  def keyword_arguments
29
- class_variable_get(:@@keyword_arguments)
29
+ @keyword_arguments ||= []
30
30
  end
31
31
 
32
32
  def owner_name
33
- class_variable_get(:@@owner_name)
34
- end
35
-
36
- def inherited(subclass)
37
- subclass.init_arguments
38
- subclass.init_keyword_arguments
39
- subclass.init_owner_name
33
+ return @owner_name unless @owner_name.nil?
34
+ return if self == ActiveMethod::Base
35
+ superclass.owner_name
40
36
  end
41
37
 
42
38
  protected
@@ -75,26 +71,9 @@ module ActiveMethod
75
71
  end
76
72
 
77
73
  def parse_method_owner(name)
78
- class_variable_set(:@@owner_name, name)
79
- end
80
-
81
- def init_arguments
82
- return if self.class_variable_defined?(:@@arguments)
83
-
84
- self.class_variable_set(:@@arguments, {})
74
+ @owner_name = name
85
75
  end
86
76
 
87
- def init_keyword_arguments
88
- return if self.class_variable_defined?(:@@keyword_arguments)
89
-
90
- self.class_variable_set(:@@keyword_arguments, [])
91
- end
92
-
93
- def init_owner_name
94
- return if self.class_variable_defined?(:@@owner_name)
95
-
96
- self.class_variable_set(:@@owner_name, nil)
97
- end
98
77
  end
99
78
 
100
79
  def initialize(*args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveMethod
4
- VERSION = "1.4.0"
4
+ VERSION = "1.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_method
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hopper Gee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-23 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Refactor your obscure method to a method object
14
14
  email: