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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b59687793d9f01e4a7c6f0db2e1fdd8e20b614446815c82f13decabf5661704b
4
- data.tar.gz: d49b1a2a72414094caff610f371fa242688e78b07f91edb38d7565a9aa5f650c
3
+ metadata.gz: bd2714ca018026119c093e7920cd6de4202f809add8780595dc1bc2d77fa4c33
4
+ data.tar.gz: dfd1dfc025023e32c2b2892b3880c2be63a54bbc347d269cee0e19533a72fa4b
5
5
  SHA512:
6
- metadata.gz: 15d8633c3f3e3e917161c4b6acaa40e16cf3a6c58fb4cbeb2c4bfb00c8f3f168e81092aa8ecd397fedcba521a4b9a58a4101e9fa70598b20e1c623f4f27c3636
7
- data.tar.gz: cf82156956b67d6b90f467ce816418cd9a56fcc05e0f98bd5c96e29fe448fde7727420489114651fdaab89c27a004759bf8508d79c4f15fafdfbebe1e59b3421
6
+ metadata.gz: 359c0c49597ed2154c73d6db25c5a0b6c6d33dc1f6a3f464d594558ef31143a278f1428c58f0319c1205b8bbe6eb703300ff17daa9f1d89df8613e041d08a80a
7
+ data.tar.gz: c1b259ebbd335fdb71e907dd9bef8c8fb1dd63bbfd1ca767be83e7a2879aebb7485d3ec18b4cc067e074ebf4a4407ccefdaf33670fe4231b09b8cee4fbbae6e0
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Peeky
4
- VERSION = '0.0.45'
4
+ VERSION = '0.0.47'
5
5
  end
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.45
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-01 00:00:00.000000000 Z
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport