binky-builder 0.2.0 → 0.4.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 +4 -4
- data/.idea/workspace.xml +320 -60
- data/README.md +26 -6
- data/lib/binky/builder.rb +21 -16
- data/lib/binky/builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01442e4435916f695b2d6a35437c7a5921b95ed494d03cfeba8777ed3e1e2890
|
4
|
+
data.tar.gz: 7b77dec7ad6724490e72c25c8468cace5eaa283063b844a078c07c1639e7a4f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fd261d5b8b81bdd9c0d5989027ce207619ef2414e09ab178f3c40c23b24301822ebe478d18b543c9f6742f5a0b60b4d8b1a3ba4daf068dbb38004c7c25d7d1
|
7
|
+
data.tar.gz: 6fe9b9c98bac12c2a9e886f6fc8c357a67afb295b582d911a50aa0e4cabb91373b5d05487ba45d759b1435e4dda148b3e237b68added5744f022a62b709f8acc
|
data/.idea/workspace.xml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
|
-
<list default="true" id="c1900bce-76f3-4483-9969-b14ec05dbe50" name="Default Changelist" comment="">
|
4
|
+
<list default="true" id="c1900bce-76f3-4483-9969-b14ec05dbe50" name="Default Changelist" comment="Binky Builder gem initial commit.">
|
5
5
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6
|
-
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
7
6
|
<change beforePath="$PROJECT_DIR$/lib/binky/builder.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/binky/builder.rb" afterDir="false" />
|
8
7
|
<change beforePath="$PROJECT_DIR$/lib/binky/builder/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/binky/builder/version.rb" afterDir="false" />
|
8
|
+
<change beforePath="$PROJECT_DIR$/test/binky/builder_test.rb" beforeDir="false" afterPath="$PROJECT_DIR$/test/binky/builder_test.rb" afterDir="false" />
|
9
9
|
</list>
|
10
10
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
11
11
|
<option name="SHOW_DIALOG" value="false" />
|
@@ -18,8 +18,17 @@
|
|
18
18
|
<file pinned="false" current-in-tab="false">
|
19
19
|
<entry file="file://$PROJECT_DIR$/lib/binky/builder.rb">
|
20
20
|
<provider selected="true" editor-type-id="text-editor">
|
21
|
-
<state relative-caret-position="
|
22
|
-
<caret line="
|
21
|
+
<state relative-caret-position="211">
|
22
|
+
<caret line="78" column="7" lean-forward="true" selection-start-line="78" selection-start-column="7" selection-end-line="78" selection-end-column="7" />
|
23
|
+
</state>
|
24
|
+
</provider>
|
25
|
+
</entry>
|
26
|
+
</file>
|
27
|
+
<file pinned="false" current-in-tab="false">
|
28
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/string.rb">
|
29
|
+
<provider selected="true" editor-type-id="text-editor">
|
30
|
+
<state relative-caret-position="33306">
|
31
|
+
<caret line="1281" column="8" selection-start-line="1281" selection-start-column="8" selection-end-line="1281" selection-end-column="8" />
|
23
32
|
</state>
|
24
33
|
</provider>
|
25
34
|
</entry>
|
@@ -27,8 +36,8 @@
|
|
27
36
|
<file pinned="false" current-in-tab="false">
|
28
37
|
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/object.rb">
|
29
38
|
<provider selected="true" editor-type-id="text-editor">
|
30
|
-
<state relative-caret-position="
|
31
|
-
<caret line="
|
39
|
+
<state relative-caret-position="18668">
|
40
|
+
<caret line="718" column="8" selection-start-line="718" selection-start-column="8" selection-end-line="718" selection-end-column="8" />
|
32
41
|
</state>
|
33
42
|
</provider>
|
34
43
|
</entry>
|
@@ -37,57 +46,64 @@
|
|
37
46
|
<entry file="file://$PROJECT_DIR$/lib/binky/builder/version.rb">
|
38
47
|
<provider selected="true" editor-type-id="text-editor">
|
39
48
|
<state relative-caret-position="52">
|
40
|
-
<caret line="2" column="
|
49
|
+
<caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
|
41
50
|
</state>
|
42
51
|
</provider>
|
43
52
|
</entry>
|
44
53
|
</file>
|
45
54
|
<file pinned="false" current-in-tab="false">
|
46
|
-
<entry file="file://$PROJECT_DIR
|
47
|
-
<provider selected="true" editor-type-id="text-editor"
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
55
|
+
<entry file="file://$PROJECT_DIR$/README.md">
|
56
|
+
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
57
|
+
<state split_layout="SPLIT">
|
58
|
+
<first_editor relative-caret-position="1404">
|
59
|
+
<caret line="54" column="3" selection-start-line="54" selection-start-column="3" selection-end-line="54" selection-end-column="3" />
|
60
|
+
</first_editor>
|
61
|
+
<second_editor />
|
62
|
+
</state>
|
63
|
+
</provider>
|
53
64
|
</entry>
|
54
65
|
</file>
|
55
66
|
<file pinned="false" current-in-tab="false">
|
56
|
-
<entry file="file://$PROJECT_DIR$/
|
67
|
+
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
57
68
|
<provider selected="true" editor-type-id="text-editor">
|
58
|
-
<state relative-caret-position="
|
59
|
-
<caret line="
|
69
|
+
<state relative-caret-position="104">
|
70
|
+
<caret line="4" selection-start-line="4" selection-end-line="4" />
|
60
71
|
</state>
|
61
72
|
</provider>
|
62
73
|
</entry>
|
63
74
|
</file>
|
64
75
|
<file pinned="false" current-in-tab="false">
|
65
|
-
<entry file="file://$PROJECT_DIR$/
|
66
|
-
<provider selected="true" editor-type-id="text-editor"
|
76
|
+
<entry file="file://$PROJECT_DIR$/test/binky/builder_test.rb">
|
77
|
+
<provider selected="true" editor-type-id="text-editor">
|
78
|
+
<state relative-caret-position="120">
|
79
|
+
<caret line="14" column="17" lean-forward="true" selection-start-line="14" selection-start-column="17" selection-end-line="14" selection-end-column="17" />
|
80
|
+
</state>
|
81
|
+
</provider>
|
67
82
|
</entry>
|
68
83
|
</file>
|
69
84
|
<file pinned="false" current-in-tab="false">
|
70
|
-
<entry file="file://$
|
71
|
-
<provider selected="true" editor-type-id="
|
72
|
-
<state
|
73
|
-
<
|
74
|
-
<caret line="42" column="15" lean-forward="true" selection-start-line="42" selection-start-column="15" selection-end-line="42" selection-end-column="15" />
|
75
|
-
</first_editor>
|
76
|
-
<second_editor />
|
85
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/module.rb">
|
86
|
+
<provider selected="true" editor-type-id="text-editor">
|
87
|
+
<state relative-caret-position="18694">
|
88
|
+
<caret line="719" column="33" selection-start-line="719" selection-start-column="18" selection-end-line="719" selection-end-column="33" />
|
77
89
|
</state>
|
78
90
|
</provider>
|
79
91
|
</entry>
|
80
92
|
</file>
|
81
93
|
<file pinned="false" current-in-tab="false">
|
82
|
-
<entry file="file://$
|
83
|
-
<provider selected="true" editor-type-id="text-editor"
|
94
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/basic_object.rb">
|
95
|
+
<provider selected="true" editor-type-id="text-editor">
|
96
|
+
<state relative-caret-position="6006">
|
97
|
+
<caret line="231" column="8" selection-start-line="231" selection-start-column="8" selection-end-line="231" selection-end-column="8" />
|
98
|
+
</state>
|
99
|
+
</provider>
|
84
100
|
</entry>
|
85
101
|
</file>
|
86
102
|
<file pinned="false" current-in-tab="false">
|
87
|
-
<entry file="file://$
|
103
|
+
<entry file="file://$USER_HOME$/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/test.rb">
|
88
104
|
<provider selected="true" editor-type-id="text-editor">
|
89
|
-
<state relative-caret-position="
|
90
|
-
<caret line="
|
105
|
+
<state relative-caret-position="5148">
|
106
|
+
<caret line="198" selection-start-line="198" selection-end-line="198" />
|
91
107
|
</state>
|
92
108
|
</provider>
|
93
109
|
</entry>
|
@@ -103,6 +119,8 @@
|
|
103
119
|
</component>
|
104
120
|
<component name="FindInProjectRecents">
|
105
121
|
<findStrings>
|
122
|
+
<find>instance_</find>
|
123
|
+
<find>instance_method</find>
|
106
124
|
<find>block</find>
|
107
125
|
</findStrings>
|
108
126
|
</component>
|
@@ -114,9 +132,9 @@
|
|
114
132
|
<list>
|
115
133
|
<option value="$PROJECT_DIR$/lib/binky/builder/builder_helper.rb" />
|
116
134
|
<option value="$PROJECT_DIR$/binky-builder.gemspec" />
|
117
|
-
<option value="$PROJECT_DIR$/test/binky/builder_test.rb" />
|
118
135
|
<option value="$PROJECT_DIR$/README.md" />
|
119
136
|
<option value="$PROJECT_DIR$/lib/binky/builder.rb" />
|
137
|
+
<option value="$PROJECT_DIR$/test/binky/builder_test.rb" />
|
120
138
|
<option value="$PROJECT_DIR$/lib/binky/builder/version.rb" />
|
121
139
|
</list>
|
122
140
|
</option>
|
@@ -144,6 +162,7 @@
|
|
144
162
|
<foldersAlwaysOnTop value="true" />
|
145
163
|
</navigator>
|
146
164
|
<panes>
|
165
|
+
<pane id="Scope" />
|
147
166
|
<pane id="ProjectPane">
|
148
167
|
<subPane>
|
149
168
|
<expand>
|
@@ -154,36 +173,36 @@
|
|
154
173
|
<path>
|
155
174
|
<item name="binky-builder" type="b2602c69:ProjectViewProjectNode" />
|
156
175
|
<item name="binky-builder" type="462c0819:PsiDirectoryNode" />
|
157
|
-
<item name="
|
176
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
158
177
|
</path>
|
159
178
|
<path>
|
160
179
|
<item name="binky-builder" type="b2602c69:ProjectViewProjectNode" />
|
161
180
|
<item name="binky-builder" type="462c0819:PsiDirectoryNode" />
|
162
181
|
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
182
|
+
<item name="binky" type="462c0819:PsiDirectoryNode" />
|
163
183
|
</path>
|
164
184
|
<path>
|
165
185
|
<item name="binky-builder" type="b2602c69:ProjectViewProjectNode" />
|
166
186
|
<item name="binky-builder" type="462c0819:PsiDirectoryNode" />
|
167
187
|
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
168
188
|
<item name="binky" type="462c0819:PsiDirectoryNode" />
|
189
|
+
<item name="builder" type="462c0819:PsiDirectoryNode" />
|
169
190
|
</path>
|
170
191
|
<path>
|
171
192
|
<item name="binky-builder" type="b2602c69:ProjectViewProjectNode" />
|
172
193
|
<item name="binky-builder" type="462c0819:PsiDirectoryNode" />
|
173
|
-
<item name="
|
174
|
-
<item name="binky" type="462c0819:PsiDirectoryNode" />
|
175
|
-
<item name="builder" type="462c0819:PsiDirectoryNode" />
|
194
|
+
<item name="test" type="462c0819:PsiDirectoryNode" />
|
176
195
|
</path>
|
177
196
|
<path>
|
178
197
|
<item name="binky-builder" type="b2602c69:ProjectViewProjectNode" />
|
179
198
|
<item name="binky-builder" type="462c0819:PsiDirectoryNode" />
|
180
199
|
<item name="test" type="462c0819:PsiDirectoryNode" />
|
200
|
+
<item name="binky" type="462c0819:PsiDirectoryNode" />
|
181
201
|
</path>
|
182
202
|
</expand>
|
183
203
|
<select />
|
184
204
|
</subPane>
|
185
205
|
</pane>
|
186
|
-
<pane id="Scope" />
|
187
206
|
</panes>
|
188
207
|
</component>
|
189
208
|
<component name="PropertiesComponent">
|
@@ -205,7 +224,36 @@
|
|
205
224
|
</list>
|
206
225
|
</option>
|
207
226
|
</component>
|
208
|
-
<component name="RunManager">
|
227
|
+
<component name="RunManager" selected="Test::Unit/Shoulda/Minitest.Run test 'builder_test': binky-builder">
|
228
|
+
<configuration name="All tests in binky-builder: binky-builder" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true">
|
229
|
+
<module name="binky-builder" />
|
230
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
231
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
232
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
233
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
234
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
235
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
236
|
+
<envs>
|
237
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
238
|
+
</envs>
|
239
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
240
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
241
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov">
|
242
|
+
<COVERAGE_PATTERN ENABLED="true">
|
243
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
244
|
+
</COVERAGE_PATTERN>
|
245
|
+
</EXTENSION>
|
246
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="$MODULE_DIR$" />
|
247
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
248
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/{*_test,test_*,*_spec}.rb" />
|
249
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
|
250
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="ALL_IN_FOLDER" />
|
251
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
252
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
253
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
254
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
255
|
+
<method v="2" />
|
256
|
+
</configuration>
|
209
257
|
<configuration name="All tests in test: binky-builder" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true">
|
210
258
|
<module name="binky-builder" />
|
211
259
|
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
@@ -235,9 +283,70 @@
|
|
235
283
|
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
236
284
|
<method v="2" />
|
237
285
|
</configuration>
|
286
|
+
<configuration name="Run test 'builder_test': binky-builder" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true">
|
287
|
+
<module name="binky-builder" />
|
288
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
289
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
290
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
291
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
292
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
293
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
294
|
+
<envs>
|
295
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
296
|
+
</envs>
|
297
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
298
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
299
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov">
|
300
|
+
<COVERAGE_PATTERN ENABLED="true">
|
301
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
302
|
+
</COVERAGE_PATTERN>
|
303
|
+
</EXTENSION>
|
304
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
305
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/binky/builder_test.rb" />
|
306
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
307
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
|
308
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
309
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
310
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
311
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
312
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
313
|
+
<method v="2" />
|
314
|
+
</configuration>
|
315
|
+
<configuration name="test_using_builder: binky-builder" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true">
|
316
|
+
<module name="binky-builder" />
|
317
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
318
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
319
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
320
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
321
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
322
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
323
|
+
<envs>
|
324
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
325
|
+
</envs>
|
326
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
327
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
328
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov">
|
329
|
+
<COVERAGE_PATTERN ENABLED="true">
|
330
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
331
|
+
</COVERAGE_PATTERN>
|
332
|
+
</EXTENSION>
|
333
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
334
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/binky/builder_test.rb" />
|
335
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
336
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="test_using_builder" />
|
337
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
338
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
339
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
340
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
341
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
342
|
+
<method v="2" />
|
343
|
+
</configuration>
|
238
344
|
<recent_temporary>
|
239
345
|
<list>
|
346
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.Run test 'builder_test': binky-builder" />
|
240
347
|
<item itemvalue="Test::Unit/Shoulda/Minitest.All tests in test: binky-builder" />
|
348
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.All tests in binky-builder: binky-builder" />
|
349
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_using_builder: binky-builder" />
|
241
350
|
</list>
|
242
351
|
</recent_temporary>
|
243
352
|
</component>
|
@@ -251,7 +360,8 @@
|
|
251
360
|
<updated>1596190242171</updated>
|
252
361
|
<workItem from="1596190243364" duration="5305000" />
|
253
362
|
<workItem from="1596196456720" duration="5542000" />
|
254
|
-
<workItem from="1596439308667" duration="
|
363
|
+
<workItem from="1596439308667" duration="19176000" />
|
364
|
+
<workItem from="1596462743515" duration="318000" />
|
255
365
|
</task>
|
256
366
|
<task id="LOCAL-00001" summary="Binky Builder gem initial commit.">
|
257
367
|
<created>1596191104643</created>
|
@@ -288,27 +398,97 @@
|
|
288
398
|
<option name="project" value="LOCAL" />
|
289
399
|
<updated>1596203897529</updated>
|
290
400
|
</task>
|
291
|
-
<
|
401
|
+
<task id="LOCAL-00006" summary="Binky Builder gem initial commit.">
|
402
|
+
<created>1596442883197</created>
|
403
|
+
<option name="number" value="00006" />
|
404
|
+
<option name="presentableId" value="LOCAL-00006" />
|
405
|
+
<option name="project" value="LOCAL" />
|
406
|
+
<updated>1596442883197</updated>
|
407
|
+
</task>
|
408
|
+
<task id="LOCAL-00007" summary="Binky Builder gem initial commit.">
|
409
|
+
<created>1596445109199</created>
|
410
|
+
<option name="number" value="00007" />
|
411
|
+
<option name="presentableId" value="LOCAL-00007" />
|
412
|
+
<option name="project" value="LOCAL" />
|
413
|
+
<updated>1596445109199</updated>
|
414
|
+
</task>
|
415
|
+
<task id="LOCAL-00008" summary="Binky Builder gem initial commit.">
|
416
|
+
<created>1596447053126</created>
|
417
|
+
<option name="number" value="00008" />
|
418
|
+
<option name="presentableId" value="LOCAL-00008" />
|
419
|
+
<option name="project" value="LOCAL" />
|
420
|
+
<updated>1596447053126</updated>
|
421
|
+
</task>
|
422
|
+
<task id="LOCAL-00009" summary="Binky Builder gem initial commit.">
|
423
|
+
<created>1596447831202</created>
|
424
|
+
<option name="number" value="00009" />
|
425
|
+
<option name="presentableId" value="LOCAL-00009" />
|
426
|
+
<option name="project" value="LOCAL" />
|
427
|
+
<updated>1596447831202</updated>
|
428
|
+
</task>
|
429
|
+
<task id="LOCAL-00010" summary="Binky Builder gem initial commit.">
|
430
|
+
<created>1596461165447</created>
|
431
|
+
<option name="number" value="00010" />
|
432
|
+
<option name="presentableId" value="LOCAL-00010" />
|
433
|
+
<option name="project" value="LOCAL" />
|
434
|
+
<updated>1596461165447</updated>
|
435
|
+
</task>
|
436
|
+
<task id="LOCAL-00011" summary="Binky Builder gem initial commit.">
|
437
|
+
<created>1596462191383</created>
|
438
|
+
<option name="number" value="00011" />
|
439
|
+
<option name="presentableId" value="LOCAL-00011" />
|
440
|
+
<option name="project" value="LOCAL" />
|
441
|
+
<updated>1596462191383</updated>
|
442
|
+
</task>
|
443
|
+
<option name="localTasksCounter" value="12" />
|
292
444
|
<servers />
|
293
445
|
</component>
|
294
446
|
<component name="TestHistory">
|
295
|
-
<history-entry file="
|
447
|
+
<history-entry file="Run_test_'builder_test'__binky-builder - 2020.08.03 at 14h 57m 57s.xml">
|
448
|
+
<configuration name="Run test 'builder_test': binky-builder" configurationId="TestUnitRunConfigurationType" />
|
449
|
+
</history-entry>
|
450
|
+
<history-entry file="All_tests_in_test__binky-builder - 2020.08.03 at 15h 10m 49s.xml">
|
451
|
+
<configuration name="All tests in test: binky-builder" configurationId="TestUnitRunConfigurationType" />
|
452
|
+
</history-entry>
|
453
|
+
<history-entry file="All_tests_in_test__binky-builder - 2020.08.03 at 15h 16m 04s.xml">
|
296
454
|
<configuration name="All tests in test: binky-builder" configurationId="TestUnitRunConfigurationType" />
|
297
455
|
</history-entry>
|
456
|
+
<history-entry file="All_tests_in_binky-builder__binky-builder - 2020.08.03 at 15h 17m 03s.xml">
|
457
|
+
<configuration name="All tests in binky-builder: binky-builder" configurationId="TestUnitRunConfigurationType" />
|
458
|
+
</history-entry>
|
459
|
+
<history-entry file="Run_test_'builder_test'__binky-builder - 2020.08.03 at 15h 21m 06s.xml">
|
460
|
+
<configuration name="Run test 'builder_test': binky-builder" configurationId="TestUnitRunConfigurationType" />
|
461
|
+
</history-entry>
|
462
|
+
<history-entry file="All_tests_in_test__binky-builder - 2020.08.03 at 15h 40m 48s.xml">
|
463
|
+
<configuration name="All tests in test: binky-builder" configurationId="TestUnitRunConfigurationType" />
|
464
|
+
</history-entry>
|
465
|
+
<history-entry file="All_tests_in_test__binky-builder - 2020.08.03 at 15h 41m 20s.xml">
|
466
|
+
<configuration name="All tests in test: binky-builder" configurationId="TestUnitRunConfigurationType" />
|
467
|
+
</history-entry>
|
468
|
+
<history-entry file="Run_test_'builder_test'__binky-builder - 2020.08.03 at 15h 42m 11s.xml">
|
469
|
+
<configuration name="Run test 'builder_test': binky-builder" configurationId="TestUnitRunConfigurationType" />
|
470
|
+
</history-entry>
|
471
|
+
<history-entry file="Run_test_'builder_test'__binky-builder - 2020.08.03 at 15h 42m 54s.xml">
|
472
|
+
<configuration name="Run test 'builder_test': binky-builder" configurationId="TestUnitRunConfigurationType" />
|
473
|
+
</history-entry>
|
474
|
+
<history-entry file="Run_test_'builder_test'__binky-builder - 2020.08.03 at 15h 57m 21s.xml">
|
475
|
+
<configuration name="Run test 'builder_test': binky-builder" configurationId="TestUnitRunConfigurationType" />
|
476
|
+
</history-entry>
|
298
477
|
</component>
|
299
478
|
<component name="TimeTrackingManager">
|
300
|
-
<option name="totallyTimeSpent" value="
|
479
|
+
<option name="totallyTimeSpent" value="30341000" />
|
301
480
|
</component>
|
302
481
|
<component name="ToolWindowManager">
|
303
482
|
<frame x="1920" y="28" width="1920" height="1052" extended-state="6" />
|
483
|
+
<editor active="true" />
|
304
484
|
<layout>
|
305
|
-
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.
|
485
|
+
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.1625" />
|
306
486
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
307
487
|
<window_info id="Favorites" order="2" side_tool="true" />
|
308
488
|
<window_info anchor="bottom" id="Message" order="0" />
|
309
489
|
<window_info anchor="bottom" id="Find" order="1" weight="0.32976827" />
|
310
|
-
<window_info anchor="bottom" id="Run" order="2" weight="0.
|
311
|
-
<window_info anchor="bottom" id="Debug" order="3" weight="0.
|
490
|
+
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.25462013" />
|
491
|
+
<window_info anchor="bottom" id="Debug" order="3" weight="0.2422998" />
|
312
492
|
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
313
493
|
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
314
494
|
<window_info anchor="bottom" id="TODO" order="6" />
|
@@ -330,8 +510,56 @@
|
|
330
510
|
<MESSAGE value="Binky Builder gem initial commit." />
|
331
511
|
<option name="LAST_COMMIT_MESSAGE" value="Binky Builder gem initial commit." />
|
332
512
|
</component>
|
513
|
+
<component name="XDebuggerManager">
|
514
|
+
<breakpoint-manager>
|
515
|
+
<breakpoints>
|
516
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
517
|
+
<url>file://$PROJECT_DIR$/test/binky/builder_test.rb</url>
|
518
|
+
<line>50</line>
|
519
|
+
<option name="timeStamp" value="5" />
|
520
|
+
</line-breakpoint>
|
521
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
522
|
+
<url>file://$PROJECT_DIR$/lib/binky/builder.rb</url>
|
523
|
+
<line>95</line>
|
524
|
+
<option name="timeStamp" value="6" />
|
525
|
+
</line-breakpoint>
|
526
|
+
</breakpoints>
|
527
|
+
</breakpoint-manager>
|
528
|
+
</component>
|
333
529
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
334
|
-
<SUITE FILE_PATH="coverage/binky_builder@
|
530
|
+
<SUITE FILE_PATH="coverage/binky_builder@All_tests_in_binky_builder__binky_builder.rcov" NAME="All tests in binky-builder: binky-builder Coverage Results" MODIFIED="1596460622083" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="binky-builder" />
|
531
|
+
<SUITE FILE_PATH="coverage/binky_builder@All_tests_in_test__binky_builder.rcov" NAME="All tests in test: binky-builder Coverage Results" MODIFIED="1596462079827" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="binky-builder" />
|
532
|
+
<SUITE FILE_PATH="coverage/binky_builder@Run_test__builder_test___binky_builder.rcov" NAME="Run test 'builder_test': binky-builder Coverage Results" MODIFIED="1596463040069" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="binky-builder" />
|
533
|
+
<SUITE FILE_PATH="coverage/binky_builder@test_using_builder__binky_builder.rcov" NAME="test_using_builder: binky-builder Coverage Results" MODIFIED="1596457170843" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="binky-builder" />
|
534
|
+
</component>
|
535
|
+
<component name="debuggerHistoryManager">
|
536
|
+
<expressions id="evaluateExpression">
|
537
|
+
<expression>
|
538
|
+
<expression-string>@obj.to_hash["id"]</expression-string>
|
539
|
+
<language-id>ruby</language-id>
|
540
|
+
<evaluation-mode>EXPRESSION</evaluation-mode>
|
541
|
+
</expression>
|
542
|
+
<expression>
|
543
|
+
<expression-string>@obj.to_hash</expression-string>
|
544
|
+
<language-id>ruby</language-id>
|
545
|
+
<evaluation-mode>EXPRESSION</evaluation-mode>
|
546
|
+
</expression>
|
547
|
+
<expression>
|
548
|
+
<expression-string>@obj.to_hash.id</expression-string>
|
549
|
+
<language-id>ruby</language-id>
|
550
|
+
<evaluation-mode>EXPRESSION</evaluation-mode>
|
551
|
+
</expression>
|
552
|
+
<expression>
|
553
|
+
<expression-string>@obj.id</expression-string>
|
554
|
+
<language-id>ruby</language-id>
|
555
|
+
<evaluation-mode>EXPRESSION</evaluation-mode>
|
556
|
+
</expression>
|
557
|
+
<expression>
|
558
|
+
<expression-string>nested_hash_value(json,key)</expression-string>
|
559
|
+
<language-id>ruby</language-id>
|
560
|
+
<evaluation-mode>EXPRESSION</evaluation-mode>
|
561
|
+
</expression>
|
562
|
+
</expressions>
|
335
563
|
</component>
|
336
564
|
<component name="editorHistoryManager">
|
337
565
|
<entry file="file://$PROJECT_DIR$/Gemfile">
|
@@ -344,6 +572,9 @@
|
|
344
572
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
345
573
|
<provider selected="true" editor-type-id="text-editor" />
|
346
574
|
</entry>
|
575
|
+
<entry file="file://$PROJECT_DIR$/LICENSE.txt">
|
576
|
+
<provider selected="true" editor-type-id="text-editor" />
|
577
|
+
</entry>
|
347
578
|
<entry file="file://$PROJECT_DIR$/binky-builder.gemspec">
|
348
579
|
<provider selected="true" editor-type-id="text-editor">
|
349
580
|
<state relative-caret-position="416">
|
@@ -351,47 +582,76 @@
|
|
351
582
|
</state>
|
352
583
|
</provider>
|
353
584
|
</entry>
|
354
|
-
<entry file="file://$
|
355
|
-
<provider selected="true" editor-type-id="text-editor" />
|
356
|
-
</entry>
|
357
|
-
<entry file="file://$PROJECT_DIR$/test/binky/builder_test.rb">
|
585
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/string.rb">
|
358
586
|
<provider selected="true" editor-type-id="text-editor">
|
359
|
-
<state relative-caret-position="
|
360
|
-
<caret line="
|
587
|
+
<state relative-caret-position="33306">
|
588
|
+
<caret line="1281" column="8" selection-start-line="1281" selection-start-column="8" selection-end-line="1281" selection-end-column="8" />
|
361
589
|
</state>
|
362
590
|
</provider>
|
363
591
|
</entry>
|
364
592
|
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/object.rb">
|
365
593
|
<provider selected="true" editor-type-id="text-editor">
|
366
|
-
<state relative-caret-position="
|
367
|
-
<caret line="
|
594
|
+
<state relative-caret-position="18668">
|
595
|
+
<caret line="718" column="8" selection-start-line="718" selection-start-column="8" selection-end-line="718" selection-end-column="8" />
|
368
596
|
</state>
|
369
597
|
</provider>
|
370
598
|
</entry>
|
371
599
|
<entry file="file://$PROJECT_DIR$/README.md">
|
372
600
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
373
601
|
<state split_layout="SPLIT">
|
374
|
-
<first_editor relative-caret-position="
|
375
|
-
<caret line="
|
602
|
+
<first_editor relative-caret-position="1404">
|
603
|
+
<caret line="54" column="3" selection-start-line="54" selection-start-column="3" selection-end-line="54" selection-end-column="3" />
|
376
604
|
</first_editor>
|
377
605
|
<second_editor />
|
378
606
|
</state>
|
379
607
|
</provider>
|
380
608
|
</entry>
|
381
609
|
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
382
|
-
<provider selected="true" editor-type-id="text-editor"
|
610
|
+
<provider selected="true" editor-type-id="text-editor">
|
611
|
+
<state relative-caret-position="104">
|
612
|
+
<caret line="4" selection-start-line="4" selection-end-line="4" />
|
613
|
+
</state>
|
614
|
+
</provider>
|
615
|
+
</entry>
|
616
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/module.rb">
|
617
|
+
<provider selected="true" editor-type-id="text-editor">
|
618
|
+
<state relative-caret-position="18694">
|
619
|
+
<caret line="719" column="33" selection-start-line="719" selection-start-column="18" selection-end-line="719" selection-end-column="33" />
|
620
|
+
</state>
|
621
|
+
</provider>
|
622
|
+
</entry>
|
623
|
+
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/basic_object.rb">
|
624
|
+
<provider selected="true" editor-type-id="text-editor">
|
625
|
+
<state relative-caret-position="6006">
|
626
|
+
<caret line="231" column="8" selection-start-line="231" selection-start-column="8" selection-end-line="231" selection-end-column="8" />
|
627
|
+
</state>
|
628
|
+
</provider>
|
629
|
+
</entry>
|
630
|
+
<entry file="file://$USER_HOME$/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/test.rb">
|
631
|
+
<provider selected="true" editor-type-id="text-editor">
|
632
|
+
<state relative-caret-position="5148">
|
633
|
+
<caret line="198" selection-start-line="198" selection-end-line="198" />
|
634
|
+
</state>
|
635
|
+
</provider>
|
383
636
|
</entry>
|
384
637
|
<entry file="file://$PROJECT_DIR$/lib/binky/builder.rb">
|
385
638
|
<provider selected="true" editor-type-id="text-editor">
|
386
|
-
<state relative-caret-position="
|
387
|
-
<caret line="
|
639
|
+
<state relative-caret-position="211">
|
640
|
+
<caret line="78" column="7" lean-forward="true" selection-start-line="78" selection-start-column="7" selection-end-line="78" selection-end-column="7" />
|
641
|
+
</state>
|
642
|
+
</provider>
|
643
|
+
</entry>
|
644
|
+
<entry file="file://$PROJECT_DIR$/test/binky/builder_test.rb">
|
645
|
+
<provider selected="true" editor-type-id="text-editor">
|
646
|
+
<state relative-caret-position="120">
|
647
|
+
<caret line="14" column="17" lean-forward="true" selection-start-line="14" selection-start-column="17" selection-end-line="14" selection-end-column="17" />
|
388
648
|
</state>
|
389
649
|
</provider>
|
390
650
|
</entry>
|
391
651
|
<entry file="file://$PROJECT_DIR$/lib/binky/builder/version.rb">
|
392
652
|
<provider selected="true" editor-type-id="text-editor">
|
393
653
|
<state relative-caret-position="52">
|
394
|
-
<caret line="2" column="
|
654
|
+
<caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
|
395
655
|
</state>
|
396
656
|
</provider>
|
397
657
|
</entry>
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ OpenStruct and accessor builder modules.
|
|
21
21
|
|
22
22
|
### Used as OpenStruct
|
23
23
|
Initialize an instance using json data, including the Builder class on your class definition.
|
24
|
-
Once initialized just use the accessors as
|
24
|
+
Once initialized just use the accessors as any other instance.
|
25
25
|
```ruby
|
26
26
|
class Issue
|
27
27
|
include Binky::Builder
|
@@ -31,20 +31,40 @@ Once initialized just use the accessors as a normal class instance.
|
|
31
31
|
super_initialize json
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
issue = Issue.new({id: 1234})
|
36
|
+
issue.id # => 1234
|
34
37
|
```
|
35
38
|
|
36
39
|
### Used on ActiveRecord models
|
37
40
|
Binky-Builder includes another helper that can be used to initialize *ActiveRecord* models based on its column names.
|
38
41
|
```ruby
|
39
|
-
class
|
40
|
-
|
42
|
+
class Issue < ApplicationRecord
|
43
|
+
include Binky::BuilderHelper
|
44
|
+
end
|
45
|
+
|
46
|
+
issue = Issue.new.build_by_keys({id: 1234},Issue.column_names) # => Issue.column_names = id:
|
47
|
+
issue.id # => 1234
|
48
|
+
```
|
49
|
+
|
50
|
+
Call *build_by_keys* method once the model has been initialized passing a json message,
|
51
|
+
it will *yield* self as a block in case you want to perform further actions.
|
52
|
+
This method will also create an instance variable called *@to_hash* contains a pair-value hash as a result.
|
53
|
+
```ruby
|
54
|
+
build_by_keys(json = {},keys = nil)
|
41
55
|
```
|
42
56
|
|
43
|
-
|
44
|
-
|
57
|
+
### Auxiliary methods
|
58
|
+
Binky-Builder comes with two extra methods to search and create instance variable and methods.
|
59
|
+
It creates a instance variable along with its accessor methods (read/write).
|
45
60
|
```ruby
|
46
|
-
|
61
|
+
accessor_builder(key, value)
|
47
62
|
```
|
63
|
+
This method goes through the whole object, being a hash, looking for the passed key and return the value found.
|
64
|
+
```ruby
|
65
|
+
nested_hash_value(obj, key)
|
66
|
+
```
|
67
|
+
|
48
68
|
|
49
69
|
## Development
|
50
70
|
|
data/lib/binky/builder.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
require "binky/builder/version"
|
2
2
|
|
3
3
|
module Binky
|
4
|
-
module
|
4
|
+
module Helper
|
5
5
|
|
6
6
|
# Parses a given json structure looking for specific keys inside the structure.
|
7
7
|
# Keys are given through a block.
|
8
8
|
# The result of it it's stored on a instance variable called to_hash and accessible through accessors with same name.
|
9
|
-
def build_by_keys(json = {})
|
9
|
+
def build_by_keys(json = {}, keys = nil)
|
10
10
|
accessor_builder('to_hash',{})
|
11
|
-
|
12
|
-
raise ArgumentError unless
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
k = keys || json&.keys
|
12
|
+
raise ArgumentError unless k&.respond_to?(:each)
|
13
|
+
json.transform_keys!(&:to_sym)
|
14
|
+
k.each do |key|
|
15
|
+
@to_hash.merge!({key.to_sym => nested_hash_value(json,key.to_sym)})
|
16
|
+
end unless json.nil?
|
17
|
+
yield self if block_given?
|
16
18
|
end
|
17
19
|
|
18
20
|
# Builds an instance variable as well as its class method accessors from a key value pair.
|
@@ -52,15 +54,15 @@ module Binky
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
55
|
-
module
|
57
|
+
module Struct
|
56
58
|
class Error < StandardError; end
|
57
|
-
include
|
59
|
+
include Helper
|
58
60
|
|
59
61
|
def initialize(json = nil)
|
60
62
|
@attributes = {}
|
61
63
|
json.each do |k, v|
|
62
64
|
self.send("#{k}=", v)
|
63
|
-
end unless json
|
65
|
+
end unless json.nil?
|
64
66
|
end
|
65
67
|
|
66
68
|
def method_missing(name, *args)
|
@@ -77,14 +79,17 @@ module Binky
|
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
80
|
-
module
|
82
|
+
module Builder
|
81
83
|
class Error < StandardError; end
|
82
|
-
include
|
84
|
+
include Helper
|
83
85
|
|
84
|
-
def initialize(json = {})
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
def initialize(json = {}, keys = nil)
|
87
|
+
k = keys || json&.keys
|
88
|
+
k&.reject! {|key| key.to_s.include?("=")}
|
89
|
+
json.transform_keys!(&:to_sym)
|
90
|
+
k&.each do |key|
|
91
|
+
self.send("#{key}=",nested_hash_value(json, key.to_sym))
|
92
|
+
end unless json.nil?
|
88
93
|
end
|
89
94
|
|
90
95
|
def method_missing(name,*args)
|