active_method 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_method/base.rb +6 -27
- data/lib/active_method/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c0688ad78d8a0b27bd65cb414eb2815684a86e415a50de9858f1e9a0bccaa91
|
4
|
+
data.tar.gz: f4d248efb0782cf91cd1476537dbc31bf3b43373813bae9dd25444651a8d9dae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a4aaea9111161b1a672ee7eecced37c7654c0ec684f82f3b4469df8577dd050fe1066a7559561094d9faf62daa8c53e3fb19a43f54645bca4667a5d849edc90
|
7
|
+
data.tar.gz: adeb5ec18322b51f25bfd998859329b246cf5d2cc06818ab93e09e040dd9ddf10959ec72be56aa6f9452eb61c605c19d08af95d37da1a31efc4aa94aec9167d0
|
data/CHANGELOG.md
CHANGED
data/lib/active_method/base.rb
CHANGED
@@ -22,21 +22,17 @@ module ActiveMethod
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def arguments
|
25
|
-
|
25
|
+
@arguments ||= {}
|
26
26
|
end
|
27
27
|
|
28
28
|
def keyword_arguments
|
29
|
-
|
29
|
+
@keyword_arguments ||= []
|
30
30
|
end
|
31
31
|
|
32
32
|
def owner_name
|
33
|
-
|
34
|
-
|
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
|
-
|
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)
|
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
|
+
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-
|
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:
|