peeky 0.0.45 → 0.0.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peeky/class_info.rb +30 -1
- data/lib/peeky/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: bd2714ca018026119c093e7920cd6de4202f809add8780595dc1bc2d77fa4c33
|
4
|
+
data.tar.gz: dfd1dfc025023e32c2b2892b3880c2be63a54bbc347d269cee0e19533a72fa4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 359c0c49597ed2154c73d6db25c5a0b6c6d33dc1f6a3f464d594558ef31143a278f1428c58f0319c1205b8bbe6eb703300ff17daa9f1d89df8613e041d08a80a
|
7
|
+
data.tar.gz: c1b259ebbd335fdb71e907dd9bef8c8fb1dd63bbfd1ca767be83e7a2879aebb7485d3ec18b4cc067e074ebf4a4407ccefdaf33670fe4231b09b8cee4fbbae6e0
|
data/lib/peeky/class_info.rb
CHANGED
@@ -17,6 +17,20 @@ module Peeky
|
|
17
17
|
@instance = instance
|
18
18
|
end
|
19
19
|
|
20
|
+
def to_h
|
21
|
+
{
|
22
|
+
class_name: class_name,
|
23
|
+
module_name: module_name,
|
24
|
+
class_full_name: class_full_name,
|
25
|
+
attr_accessor: accessors.map(&:name),
|
26
|
+
attr_reader: readers.map(&:name),
|
27
|
+
attr_writer: writers.map(&:name),
|
28
|
+
klass: methods_to_h(class_methods),
|
29
|
+
instance_public: methods_to_h(public_methods),
|
30
|
+
instance_private: methods_to_h(private_methods)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
20
34
|
# rubocop:disable Metrics/AbcSize
|
21
35
|
def to_s
|
22
36
|
result = []
|
@@ -218,7 +232,7 @@ module Peeky
|
|
218
232
|
end
|
219
233
|
|
220
234
|
def ruby_class_method_names
|
221
|
-
@ruby_class_method_names ||= instance.class.singleton_class.instance_methods(false).sort
|
235
|
+
@ruby_class_method_names ||= instance.class.methods(false).sort # singleton_class.instance_methods(false).sort
|
222
236
|
end
|
223
237
|
|
224
238
|
def ruby_instance_method_names
|
@@ -249,5 +263,20 @@ module Peeky
|
|
249
263
|
# puts 'ruby_instance_methods'
|
250
264
|
puts e
|
251
265
|
end
|
266
|
+
|
267
|
+
def methods_to_h(methods)
|
268
|
+
methods.map do |m|
|
269
|
+
{
|
270
|
+
name: m.name,
|
271
|
+
paramaters: m.parameters.map do |p|
|
272
|
+
{
|
273
|
+
name: p.name,
|
274
|
+
type: p.type,
|
275
|
+
default_value: p.default_value
|
276
|
+
}
|
277
|
+
end
|
278
|
+
}
|
279
|
+
end
|
280
|
+
end
|
252
281
|
end
|
253
282
|
end
|
data/lib/peeky/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peeky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|