peeky 0.0.19 → 0.0.33
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 +4 -4
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +4 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +6 -3
- data/Guardfile +4 -4
- data/README.md +96 -9
- data/{README-stories.md → STORIES.md} +28 -4
- data/USAGE.md +438 -0
- data/lib/peeky.rb +4 -0
- data/lib/peeky/api.rb +74 -0
- data/lib/peeky/class_info.rb +139 -29
- data/lib/peeky/example/yard_sample.rb +124 -0
- data/lib/peeky/method_info.rb +5 -4
- data/lib/peeky/parameter_info.rb +96 -21
- data/lib/peeky/predicates/attr_reader_predicate.rb +16 -4
- data/lib/peeky/predicates/attr_writer_predicate.rb +8 -0
- data/lib/peeky/renderer/class_debug_render.rb +95 -0
- data/lib/peeky/renderer/class_interface_render.rb +9 -9
- data/lib/peeky/renderer/class_interface_yard_render.rb +141 -0
- data/lib/peeky/renderer/method_call_minimum_params_render.rb +4 -5
- data/lib/peeky/renderer/method_signature_render.rb +44 -13
- data/lib/peeky/renderer/method_signature_with_debug_render.rb +11 -11
- data/lib/peeky/version.rb +1 -1
- data/peeky.gemspec +15 -3
- metadata +35 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f39a9477e701fff31e203e1d90fb479cd8898662499edf4c4722673e7c0da20
|
4
|
+
data.tar.gz: d7a743fc208c5dbfe640c687833e3cc69b663654630cad0d15a582033f3f39f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1a24d91ef1fef5b72fc90f2c041112462cc842009ed68f9499f9a94cc3218ff0e2a0bc46ba4b5564487891b54d2bff023cf4deaa8af64a607f207b4f6a8e6f
|
7
|
+
data.tar.gz: 8fe132fffb24332d7b28b92a288b799ed51dac71df7bcfb8887bec7c6433c3b58bda9a6af05cb81dc006322b5991b6b05735760756dcef4c8919575e16155bd8
|
data/.rubocop.yml
CHANGED
@@ -4,8 +4,28 @@ AllCops:
|
|
4
4
|
NewCops: enable
|
5
5
|
Exclude:
|
6
6
|
- "_/**/*"
|
7
|
+
- "lib/peeky/example/yard_sample.rb"
|
7
8
|
|
8
9
|
# My Preferences - Start
|
10
|
+
Naming/MemoizedInstanceVariableName:
|
11
|
+
Enabled: false
|
12
|
+
Naming/VariableNumber:
|
13
|
+
Exclude:
|
14
|
+
- "**/spec/**/*"
|
15
|
+
Style/EmptyMethod:
|
16
|
+
Exclude:
|
17
|
+
- "**/spec/**/*"
|
18
|
+
Metrics/ParameterLists:
|
19
|
+
Exclude:
|
20
|
+
- "**/spec/**/*"
|
21
|
+
Layout/EmptyLineBetweenDefs:
|
22
|
+
Exclude:
|
23
|
+
- "**/spec/**/*"
|
24
|
+
|
25
|
+
Lint/AmbiguousBlockAssociation:
|
26
|
+
Exclude:
|
27
|
+
- "**/spec/**/*"
|
28
|
+
|
9
29
|
Style/AccessorGrouping:
|
10
30
|
Enabled: false
|
11
31
|
|
@@ -16,6 +36,7 @@ Layout/SpaceBeforeComma:
|
|
16
36
|
Metrics/BlockLength:
|
17
37
|
Exclude:
|
18
38
|
- "**/spec/*"
|
39
|
+
- "*.gemspec"
|
19
40
|
ExcludedMethods:
|
20
41
|
- configure
|
21
42
|
- context
|
data/.rubocop_todo.yml
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at david
|
58
|
+
reported by contacting the project team at david@ideasmne.com.au. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/Gemfile
CHANGED
@@ -5,13 +5,16 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in poc_github_ap.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
+
# group :development do
|
9
|
+
# # pry on steroids
|
10
|
+
# gem 'pry-coolline', github: 'owst/pry-coolline', branch: 'support_new_pry_config_api'
|
11
|
+
# gem 'jazz_fingers'
|
12
|
+
# end
|
13
|
+
|
8
14
|
group :development, :test do
|
9
15
|
gem 'guard-bundler'
|
10
16
|
gem 'guard-rspec'
|
11
17
|
gem 'guard-rubocop'
|
12
|
-
# pry on steroids
|
13
|
-
# gem 'pry-coolline', github: 'owst/pry-coolline', branch: 'support_new_pry_config_api'
|
14
|
-
gem 'jazz_fingers'
|
15
18
|
gem 'rake', '~> 12.0'
|
16
19
|
# this is used for cmdlets 'self-executing gems'
|
17
20
|
gem 'rake-compiler'
|
data/Guardfile
CHANGED
@@ -23,8 +23,8 @@ group :green_pass_then_cop, halt_on_fail: true do
|
|
23
23
|
watch(%r{^lib/peeky/commands/(.+)\.rb$}) { |m| "spec/unit/commands/#{m[1]}_spec.rb" }
|
24
24
|
end
|
25
25
|
|
26
|
-
guard :rubocop, all_on_start: false, cli: ['--format', 'clang'] do
|
27
|
-
|
28
|
-
|
29
|
-
end
|
26
|
+
# guard :rubocop, all_on_start: false, cli: ['--format', 'clang'] do
|
27
|
+
# watch(%r{.+\.rb$})
|
28
|
+
# watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
|
29
|
+
# end
|
30
30
|
end
|
data/README.md
CHANGED
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
> Peeky is a Ruby GEM for peaking into ruby classes and extracting meta
|
4
4
|
|
5
|
-
Welcome to your new ruby gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/peeky`.
|
6
|
-
|
7
5
|
When using the source code for this gem, start by running `bin/setup` to install locally or `bundle install`
|
8
6
|
|
9
|
-
To experiment with that code, run `bin/console` for an interactive prompt or run `exe/peeky` to see a list of commands.
|
10
|
-
|
11
7
|
## Installation
|
12
8
|
|
13
9
|
Add this line to your application's Gemfile:
|
@@ -34,17 +30,108 @@ gem install peeky
|
|
34
30
|
|
35
31
|
As a Ruby Developer, I should be able to Reverse engineer classes and methods, so that I can document and understand them
|
36
32
|
|
37
|
-
See all [stories](./
|
33
|
+
See all [stories](./STORIES.md)
|
38
34
|
|
39
35
|
### Featured Stories
|
40
36
|
|
41
37
|
- As a Developer, I should be able to interrogate class instance information, so that I can reverse engineer a ruby class
|
42
|
-
- As a Developer, I can render method with minimal parameter calls, So that I know the minimum parameters when calling a method
|
38
|
+
- As a Developer, I can render a method with minimal parameter calls, So that I know the minimum parameters when calling a method
|
43
39
|
- As a Developer, I can render a class with instance attributes and methods, So that I can quickly mock out an entire class
|
44
40
|
|
45
41
|
## Usage
|
46
42
|
|
47
|
-
|
43
|
+
See all [usage examples](./USAGE.md)
|
44
|
+
|
45
|
+
### Basic Example
|
46
|
+
|
47
|
+
This example assumes you have this simple class
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
module Sample
|
53
|
+
class SimpleClass
|
54
|
+
attr_accessor :read_write
|
55
|
+
|
56
|
+
def position_and_optional(aaa, bbb = 1)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
62
|
+
|
63
|
+
### Rendering Examples
|
64
|
+
|
65
|
+
Here a list of example renderers for the simple class
|
66
|
+
|
67
|
+
#### Class interface
|
68
|
+
Render simple class using class_interface renderer with compact formatting
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
puts api.render_class(:class_interface, instance: Sample::SimpleClass.new)
|
72
|
+
```
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
class SimpleClass
|
78
|
+
attr_accessor :read_write
|
79
|
+
|
80
|
+
def position_and_optional(aaa, bbb = nil); end
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
#### Documented class interface
|
85
|
+
Render simple class using class_interface_yard renderer to product YARD compatible documentation
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
puts api.render_class(:class_interface_yard, instance: Sample::SimpleClass.new)
|
89
|
+
```
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
class SimpleClass
|
95
|
+
# Read write
|
96
|
+
attr_accessor :read_write
|
97
|
+
|
98
|
+
# Position and optional
|
99
|
+
#
|
100
|
+
# @param aaa [String] aaa (required)
|
101
|
+
# @param bbb [String] bbb (optional)
|
102
|
+
def position_and_optional(aaa, bbb = nil)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
```
|
106
|
+
|
107
|
+
#### Class debug
|
108
|
+
Render debug information
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
puts api.render_class(:class_debug, instance: Sample::SimpleClass.new)
|
112
|
+
```
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
```text
|
117
|
+
----------------------------------------------------------------------
|
118
|
+
class name : SimpleClass
|
119
|
+
module name : Sample
|
120
|
+
class full name : Sample::SimpleClass
|
121
|
+
|
122
|
+
-- Attributes --------------------------------------------------------
|
123
|
+
attr_accessor : read_write
|
124
|
+
|
125
|
+
-- Public Methods ----------------------------------------------------
|
126
|
+
position_and_optional::
|
127
|
+
name param format type
|
128
|
+
----------------------------------------------------------------------
|
129
|
+
aaa aaa param_required
|
130
|
+
bbb bbb = nil param_optional
|
131
|
+
```
|
132
|
+
|
133
|
+
|
134
|
+
|
48
135
|
|
49
136
|
## Development
|
50
137
|
|
@@ -54,7 +141,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
54
141
|
|
55
142
|
## Contributing
|
56
143
|
|
57
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
144
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/klueless-io/peeky. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
58
145
|
|
59
146
|
## License
|
60
147
|
|
@@ -62,7 +149,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
62
149
|
|
63
150
|
## Code of Conduct
|
64
151
|
|
65
|
-
Everyone interacting in the Peeky project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
152
|
+
Everyone interacting in the Peeky project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/klueless-io/peeky/blob/master/CODE_OF_CONDUCT.md).
|
66
153
|
|
67
154
|
## Copyright
|
68
155
|
|
@@ -4,7 +4,26 @@
|
|
4
4
|
|
5
5
|
As a Ruby Developer, I should be able to Reverse engineer classes and methods, so that I can document and understand them
|
6
6
|
|
7
|
-
##
|
7
|
+
## Development radar
|
8
|
+
|
9
|
+
|
10
|
+
### Tasks next on list
|
11
|
+
|
12
|
+
As a Developer, I can use Peeky with a simple API, so that I use Peeky quickly
|
13
|
+
|
14
|
+
- Add simplified API with examples
|
15
|
+
- Start documenting usage instructions
|
16
|
+
|
17
|
+
As a Developer, I can quickly build requirements, so that I can document project features
|
18
|
+
|
19
|
+
- Add support for backlog stories and tasks
|
20
|
+
- Add usage instructions
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
## Stories and tasks
|
25
|
+
|
26
|
+
### Stories - completed
|
8
27
|
|
9
28
|
As a Developer, I can render a class with instance attributes and methods, So that I can quickly mock out an entire class
|
10
29
|
|
@@ -18,7 +37,7 @@ As a Developer, I can see the method signature of a method, So that I understand
|
|
18
37
|
|
19
38
|
- Render: Method Signature in compact format
|
20
39
|
|
21
|
-
As a Developer, I can render method with minimal parameter calls, So that I know the minimum parameters when calling a method
|
40
|
+
As a Developer, I can render a method with minimal parameter calls, So that I know the minimum parameters when calling a method
|
22
41
|
|
23
42
|
- Render: Simple instance method calls with minimum parameters
|
24
43
|
|
@@ -35,15 +54,20 @@ As a Developer, I should be able to interrogate class instance information, so t
|
|
35
54
|
- ClassInfo stores information about a ruby class. Only support instance methods
|
36
55
|
|
37
56
|
|
38
|
-
|
57
|
+
### Tasks - completed
|
58
|
+
|
59
|
+
As a Developer, I can render a class with RDoc documentation, so that I do not have to manually type RDoc references
|
39
60
|
|
40
61
|
|
62
|
+
As a Developer, I can read detailed API documentation on Peaky, so that I use Peeky quickly
|
63
|
+
|
64
|
+
- Acid Test: Use the YARD renderer to document Peaky the GEM
|
65
|
+
|
41
66
|
Setup GitHub Action (test and lint)
|
42
67
|
|
43
68
|
- Setup Rspec action
|
44
69
|
- Setup RuboCop action
|
45
70
|
|
46
|
-
|
47
71
|
Setup new Ruby GEM
|
48
72
|
|
49
73
|
- Build out a standard GEM structure
|
data/USAGE.md
ADDED
@@ -0,0 +1,438 @@
|
|
1
|
+
# Peeky
|
2
|
+
|
3
|
+
> Peeky is a Ruby GEM for peaking into ruby classes and extracting meta
|
4
|
+
|
5
|
+
As a Ruby Developer, I should be able to Reverse engineer classes and methods, so that I can document and understand them
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
### Sample Classes
|
10
|
+
|
11
|
+
The usage examples listed below will work with these sample classes
|
12
|
+
|
13
|
+
#### Simple example
|
14
|
+
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
module Sample
|
18
|
+
class SimpleClass
|
19
|
+
attr_accessor :read_write
|
20
|
+
|
21
|
+
def position_and_optional(aaa, bbb = 1)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Complex example
|
28
|
+
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
module Sample
|
32
|
+
class ComplexClass
|
33
|
+
attr_accessor :a_read_write1, :a_read_write2
|
34
|
+
attr_reader :b_reader, :b_another_reader
|
35
|
+
attr_writer :c_writer, :c_another_writer
|
36
|
+
|
37
|
+
def do_something_method
|
38
|
+
end
|
39
|
+
|
40
|
+
def looks_like_an_attr_reader
|
41
|
+
@looks_like_an_attr_reader ||= 5
|
42
|
+
end
|
43
|
+
|
44
|
+
def method_01(aaa); end
|
45
|
+
|
46
|
+
def method_02(aaa, bbb = 1); end
|
47
|
+
|
48
|
+
def method_03(aaa, bbb = 1, ccc = 2); end
|
49
|
+
|
50
|
+
def method_04(*aaa); end
|
51
|
+
|
52
|
+
def method_05(aaa, bbb = 1, *ccc); end
|
53
|
+
|
54
|
+
def method_06(**aaa); end
|
55
|
+
|
56
|
+
def method_07(aaa, *bbb, **ccc); end
|
57
|
+
|
58
|
+
def method_08(aaa, *bbb, **ccc, &ddd); end
|
59
|
+
|
60
|
+
def method_09(aaa:); end
|
61
|
+
|
62
|
+
def method_10(aaa:, bbb: 1); end
|
63
|
+
|
64
|
+
def questionable?; end
|
65
|
+
|
66
|
+
def destructive!; end
|
67
|
+
|
68
|
+
def method_with_every_type_of_paramater(aaa, bbb = 1, *ccc, ddd:, eee: 1, **fff, &ggg); end
|
69
|
+
|
70
|
+
# Check that methods are sorted
|
71
|
+
def alpha_sort2; end
|
72
|
+
def alpha_sort1; end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
```
|
76
|
+
|
77
|
+
|
78
|
+
### Build Class Information
|
79
|
+
|
80
|
+
Use build_class_info to extract meta data from a ruby class
|
81
|
+
|
82
|
+
#### Build ClassInfo
|
83
|
+
By default information is lazy loaded only when accessed
|
84
|
+
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
class_info = api.build_class_info(Sample::SimpleClass.new)
|
88
|
+
|
89
|
+
puts class_info
|
90
|
+
```
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
```shell
|
95
|
+
Sample::SimpleClass
|
96
|
+
```
|
97
|
+
|
98
|
+
#### Build ClassInfo - pre-loaded
|
99
|
+
Pre-load will ensure that methods and parameters are loaded straight away.
|
100
|
+
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
class_info = api.build_class_info(Sample::ComplexClass.new, lazy: false)
|
104
|
+
|
105
|
+
puts class_info
|
106
|
+
```
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
```shell
|
111
|
+
Sample::ComplexClass
|
112
|
+
```
|
113
|
+
|
114
|
+
|
115
|
+
### Render Class
|
116
|
+
|
117
|
+
Render a class using a pre-defined class renderer that can be referenced by key
|
118
|
+
|
119
|
+
#### Render class interface using class_info
|
120
|
+
Render a basic class interface in compact format "One line per method".
|
121
|
+
|
122
|
+
Note: Modules are not yet supported in Peeky
|
123
|
+
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
class_info = api.build_class_info(Sample::SimpleClass.new)
|
127
|
+
|
128
|
+
puts api.render_class(:class_interface, class_info: class_info)
|
129
|
+
```
|
130
|
+
|
131
|
+
#### Render class interface using an instance of the intended class
|
132
|
+
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
puts api.render_class(:class_interface, instance: Sample::SimpleClass.new)
|
136
|
+
```
|
137
|
+
|
138
|
+
|
139
|
+
### Render Class Examples
|
140
|
+
|
141
|
+
Here a list of example renderers for the complex class
|
142
|
+
|
143
|
+
#### Class interface
|
144
|
+
Render simple class using class_interface renderer
|
145
|
+
|
146
|
+
```ruby
|
147
|
+
puts api.render_class(:class_interface, instance: Sample::SimpleClass.new)
|
148
|
+
```
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
```ruby
|
153
|
+
class ComplexClass
|
154
|
+
attr_accessor :a_read_write1
|
155
|
+
attr_accessor :a_read_write2
|
156
|
+
|
157
|
+
attr_reader :b_another_reader
|
158
|
+
attr_reader :b_reader
|
159
|
+
attr_reader :looks_like_an_attr_reader
|
160
|
+
|
161
|
+
attr_writer :c_another_writer
|
162
|
+
attr_writer :c_writer
|
163
|
+
|
164
|
+
def alpha_sort1; end
|
165
|
+
def alpha_sort2; end
|
166
|
+
def destructive!; end
|
167
|
+
def do_something_method; end
|
168
|
+
def method_01(aaa); end
|
169
|
+
def method_02(aaa, bbb = nil); end
|
170
|
+
def method_03(aaa, bbb = nil, ccc = nil); end
|
171
|
+
def method_04(*aaa); end
|
172
|
+
def method_05(aaa, bbb = nil, *ccc); end
|
173
|
+
def method_06(**aaa); end
|
174
|
+
def method_07(aaa, *bbb, **ccc); end
|
175
|
+
def method_08(aaa, *bbb, **ccc, &ddd); end
|
176
|
+
def method_09(aaa:); end
|
177
|
+
def method_10(aaa:, bbb: nil); end
|
178
|
+
def method_with_every_type_of_paramater(aaa, bbb = nil, *ccc, ddd:, eee: nil, **fff, &ggg);end
|
179
|
+
def questionable?; end
|
180
|
+
end
|
181
|
+
```
|
182
|
+
|
183
|
+
#### Class interface - YARD
|
184
|
+
Render complex class using class_interface_yard renderer
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
puts api.render_class(:class_interface_yard, instance: Sample::ComplexClass.new)
|
188
|
+
```
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
class ComplexClass
|
194
|
+
# A read write1
|
195
|
+
attr_accessor :a_read_write1
|
196
|
+
|
197
|
+
# A read write2
|
198
|
+
attr_accessor :a_read_write2
|
199
|
+
|
200
|
+
# B another reader
|
201
|
+
attr_reader :b_another_reader
|
202
|
+
|
203
|
+
# B reader
|
204
|
+
attr_reader :b_reader
|
205
|
+
|
206
|
+
# Looks like an attr reader
|
207
|
+
attr_reader :looks_like_an_attr_reader
|
208
|
+
|
209
|
+
# C another writer
|
210
|
+
attr_writer :c_another_writer
|
211
|
+
|
212
|
+
# C writer
|
213
|
+
attr_writer :c_writer
|
214
|
+
|
215
|
+
# Alpha sort1
|
216
|
+
def alpha_sort1
|
217
|
+
end
|
218
|
+
|
219
|
+
# Alpha sort2
|
220
|
+
def alpha_sort2
|
221
|
+
end
|
222
|
+
|
223
|
+
# Destructive!
|
224
|
+
def destructive!
|
225
|
+
end
|
226
|
+
|
227
|
+
# Do something method
|
228
|
+
def do_something_method
|
229
|
+
end
|
230
|
+
|
231
|
+
# Method 01
|
232
|
+
#
|
233
|
+
# @param aaa [String] aaa (required)
|
234
|
+
def method_01(aaa)
|
235
|
+
end
|
236
|
+
|
237
|
+
# Method 02
|
238
|
+
#
|
239
|
+
# @param aaa [String] aaa (required)
|
240
|
+
# @param bbb [String] bbb (optional)
|
241
|
+
def method_02(aaa, bbb = nil)
|
242
|
+
end
|
243
|
+
|
244
|
+
# Method 03
|
245
|
+
#
|
246
|
+
# @param aaa [String] aaa (required)
|
247
|
+
# @param bbb [String] bbb (optional)
|
248
|
+
# @param ccc [String] ccc (optional)
|
249
|
+
def method_03(aaa, bbb = nil, ccc = nil)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Method 04
|
253
|
+
#
|
254
|
+
# @param aaa [Array<Object>] *aaa - list of aaa
|
255
|
+
def method_04(*aaa)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Method 05
|
259
|
+
#
|
260
|
+
# @param aaa [String] aaa (required)
|
261
|
+
# @param bbb [String] bbb (optional)
|
262
|
+
# @param ccc [Array<Object>] *ccc - list of ccc
|
263
|
+
def method_05(aaa, bbb = nil, *ccc)
|
264
|
+
end
|
265
|
+
|
266
|
+
# Method 06
|
267
|
+
#
|
268
|
+
# @param aaa [<key: value>...] **aaa - list of key/values
|
269
|
+
def method_06(**aaa)
|
270
|
+
end
|
271
|
+
|
272
|
+
# Method 07
|
273
|
+
#
|
274
|
+
# @param aaa [String] aaa (required)
|
275
|
+
# @param bbb [Array<Object>] *bbb - list of bbb
|
276
|
+
# @param ccc [<key: value>...] **ccc - list of key/values
|
277
|
+
def method_07(aaa, *bbb, **ccc)
|
278
|
+
end
|
279
|
+
|
280
|
+
# Method 08
|
281
|
+
#
|
282
|
+
# @param aaa [String] aaa (required)
|
283
|
+
# @param bbb [Array<Object>] *bbb - list of bbb
|
284
|
+
# @param ccc [<key: value>...] **ccc - list of key/values
|
285
|
+
# @param ddd [Block] &ddd
|
286
|
+
def method_08(aaa, *bbb, **ccc, &ddd)
|
287
|
+
end
|
288
|
+
|
289
|
+
# Method 09
|
290
|
+
#
|
291
|
+
# @param aaa [String] aaa: <value for aaa> (required)
|
292
|
+
def method_09(aaa:)
|
293
|
+
end
|
294
|
+
|
295
|
+
# Method 10
|
296
|
+
#
|
297
|
+
# @param aaa [String] aaa: <value for aaa> (required)
|
298
|
+
# @param bbb [String] bbb: <value for bbb> (optional)
|
299
|
+
def method_10(aaa:, bbb: nil)
|
300
|
+
end
|
301
|
+
|
302
|
+
# Method with every type of paramater
|
303
|
+
#
|
304
|
+
# @param aaa [String] aaa (required)
|
305
|
+
# @param bbb [String] bbb (optional)
|
306
|
+
# @param ccc [Array<Object>] *ccc - list of ccc
|
307
|
+
# @param ddd [String] ddd: <value for ddd> (required)
|
308
|
+
# @param eee [String] eee: <value for eee> (optional)
|
309
|
+
# @param fff [<key: value>...] **fff - list of key/values
|
310
|
+
# @param ggg [Block] &ggg
|
311
|
+
def method_with_every_type_of_paramater(aaa, bbb = nil, *ccc, ddd:, eee: nil, **fff, &ggg)
|
312
|
+
end
|
313
|
+
|
314
|
+
# Questionable?
|
315
|
+
#
|
316
|
+
# @return [Boolean] true when questionable?
|
317
|
+
def questionable?
|
318
|
+
end
|
319
|
+
end
|
320
|
+
```
|
321
|
+
|
322
|
+
#### Debug class info
|
323
|
+
Render debug information on complex class
|
324
|
+
|
325
|
+
```ruby
|
326
|
+
puts api.render_class(:class_debug, instance: Sample::ComplexClass.new)
|
327
|
+
```
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
```text
|
332
|
+
----------------------------------------------------------------------
|
333
|
+
class name : ComplexClass
|
334
|
+
module name : Sample
|
335
|
+
class full name : Sample::ComplexClass
|
336
|
+
|
337
|
+
-- Attributes --------------------------------------------------------
|
338
|
+
attr_accessor : a_read_write1
|
339
|
+
attr_accessor : a_read_write2
|
340
|
+
attr_reader : b_another_reader
|
341
|
+
attr_reader : b_reader
|
342
|
+
attr_reader : looks_like_an_attr_reader
|
343
|
+
attr_writer : c_another_writer
|
344
|
+
attr_writer : c_writer
|
345
|
+
|
346
|
+
-- Public Methods ----------------------------------------------------
|
347
|
+
alpha_sort1::
|
348
|
+
name param format type
|
349
|
+
----------------------------------------------------------------------
|
350
|
+
|
351
|
+
alpha_sort2::
|
352
|
+
name param format type
|
353
|
+
----------------------------------------------------------------------
|
354
|
+
|
355
|
+
destructive!::
|
356
|
+
name param format type
|
357
|
+
----------------------------------------------------------------------
|
358
|
+
|
359
|
+
do_something_method::
|
360
|
+
name param format type
|
361
|
+
----------------------------------------------------------------------
|
362
|
+
|
363
|
+
method_01::
|
364
|
+
name param format type
|
365
|
+
----------------------------------------------------------------------
|
366
|
+
aaa aaa param_required
|
367
|
+
|
368
|
+
method_02::
|
369
|
+
name param format type
|
370
|
+
----------------------------------------------------------------------
|
371
|
+
aaa aaa param_required
|
372
|
+
bbb bbb = nil param_optional
|
373
|
+
|
374
|
+
method_03::
|
375
|
+
name param format type
|
376
|
+
----------------------------------------------------------------------
|
377
|
+
aaa aaa param_required
|
378
|
+
bbb bbb = nil param_optional
|
379
|
+
ccc ccc = nil param_optional
|
380
|
+
|
381
|
+
method_04::
|
382
|
+
name param format type
|
383
|
+
----------------------------------------------------------------------
|
384
|
+
aaa *aaa splat
|
385
|
+
|
386
|
+
method_05::
|
387
|
+
name param format type
|
388
|
+
----------------------------------------------------------------------
|
389
|
+
aaa aaa param_required
|
390
|
+
bbb bbb = nil param_optional
|
391
|
+
ccc *ccc splat
|
392
|
+
|
393
|
+
method_06::
|
394
|
+
name param format type
|
395
|
+
----------------------------------------------------------------------
|
396
|
+
aaa **aaa double_splat
|
397
|
+
|
398
|
+
method_07::
|
399
|
+
name param format type
|
400
|
+
----------------------------------------------------------------------
|
401
|
+
aaa aaa param_required
|
402
|
+
bbb *bbb splat
|
403
|
+
ccc **ccc double_splat
|
404
|
+
|
405
|
+
method_08::
|
406
|
+
name param format type
|
407
|
+
----------------------------------------------------------------------
|
408
|
+
aaa aaa param_required
|
409
|
+
bbb *bbb splat
|
410
|
+
ccc **ccc double_splat
|
411
|
+
ddd &ddd block
|
412
|
+
|
413
|
+
method_09::
|
414
|
+
name param format type
|
415
|
+
----------------------------------------------------------------------
|
416
|
+
aaa aaa: key_required
|
417
|
+
|
418
|
+
method_10::
|
419
|
+
name param format type
|
420
|
+
----------------------------------------------------------------------
|
421
|
+
aaa aaa: key_required
|
422
|
+
bbb bbb: nil key_optional
|
423
|
+
|
424
|
+
method_with_every_type_of_paramater::
|
425
|
+
name param format type
|
426
|
+
----------------------------------------------------------------------
|
427
|
+
aaa aaa param_required
|
428
|
+
bbb bbb = nil param_optional
|
429
|
+
ccc *ccc splat
|
430
|
+
ddd ddd: key_required
|
431
|
+
eee eee: nil key_optional
|
432
|
+
fff **fff double_splat
|
433
|
+
ggg &ggg block
|
434
|
+
|
435
|
+
questionable?::
|
436
|
+
name param format type
|
437
|
+
----------------------------------------------------------------------
|
438
|
+
```
|