ae_easy-core 0.1.9 → 0.2.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/README.md +1 -1
- data/ae_easy-core.gemspec +1 -1
- data/doc/AeEasy.html +116 -116
- data/doc/AeEasy/Core.html +1217 -1217
- data/doc/AeEasy/Core/Config.html +284 -284
- data/doc/AeEasy/Core/Exception.html +116 -116
- data/doc/AeEasy/Core/Exception/OutdatedError.html +132 -132
- data/doc/AeEasy/Core/Helper.html +116 -116
- data/doc/AeEasy/Core/Helper/Cookie.html +797 -797
- data/doc/AeEasy/Core/Mock.html +231 -231
- data/doc/AeEasy/Core/Mock/FakeDb.html +3133 -2729
- data/doc/AeEasy/Core/Mock/FakeExecutor.html +2852 -2259
- data/doc/AeEasy/Core/Mock/FakeFinisher.html +160 -0
- data/doc/AeEasy/Core/Mock/FakeParser.html +157 -157
- data/doc/AeEasy/Core/Mock/FakeSeeder.html +157 -157
- data/doc/AeEasy/Core/Plugin.html +116 -116
- data/doc/AeEasy/Core/Plugin/CollectionVault.html +262 -262
- data/doc/AeEasy/Core/Plugin/ConfigBehavior.html +471 -471
- data/doc/AeEasy/Core/Plugin/ContextIntegrator.html +365 -365
- data/doc/AeEasy/Core/Plugin/Executor.html +243 -243
- data/doc/AeEasy/Core/Plugin/ExecutorBehavior.html +299 -299
- data/doc/AeEasy/Core/Plugin/Finisher.html +265 -0
- data/doc/AeEasy/Core/Plugin/FinisherBehavior.html +142 -0
- data/doc/AeEasy/Core/Plugin/InitializeHook.html +198 -198
- data/doc/AeEasy/Core/Plugin/Parser.html +254 -254
- data/doc/AeEasy/Core/Plugin/ParserBehavior.html +216 -216
- data/doc/AeEasy/Core/Plugin/Seeder.html +594 -594
- data/doc/AeEasy/Core/Plugin/SeederBehavior.html +141 -141
- data/doc/AeEasy/Core/SmartCollection.html +804 -804
- data/doc/_index.html +363 -342
- data/doc/class_list.html +51 -51
- data/doc/css/full_list.css +58 -58
- data/doc/css/style.css +496 -496
- data/doc/file.README.html +70 -70
- data/doc/file_list.html +56 -56
- data/doc/frames.html +17 -17
- data/doc/index.html +70 -70
- data/doc/js/app.js +303 -292
- data/doc/js/full_list.js +216 -216
- data/doc/js/jquery.js +3 -3
- data/doc/method_list.html +939 -851
- data/doc/top-level-namespace.html +109 -109
- data/lib/ae_easy/core/mock.rb +1 -0
- data/lib/ae_easy/core/mock/fake_db.rb +67 -1
- data/lib/ae_easy/core/mock/fake_executor.rb +61 -0
- data/lib/ae_easy/core/mock/fake_finisher.rb +28 -0
- data/lib/ae_easy/core/mock/fake_parser.rb +3 -1
- data/lib/ae_easy/core/plugin.rb +2 -0
- data/lib/ae_easy/core/plugin/finisher.rb +19 -0
- data/lib/ae_easy/core/plugin/finisher_behavior.rb +9 -0
- data/lib/ae_easy/core/version.rb +1 -1
- metadata +10 -4
@@ -1,142 +1,142 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Module: AeEasy::Core::Plugin::SeederBehavior
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "AeEasy::Core::Plugin::SeederBehavior";
|
19
|
-
relpath = '../../../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../../../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../../../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../../../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span> » <span class='title'><span class='object_link'><a href="../../Core.html" title="AeEasy::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../Plugin.html" title="AeEasy::Core::Plugin (module)">Plugin</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">SeederBehavior</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../../../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Module: AeEasy::Core::Plugin::SeederBehavior
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
<dl>
|
75
|
-
<dt>Includes:</dt>
|
76
|
-
<dd><span class='object_link'><a href="ExecutorBehavior.html" title="AeEasy::Core::Plugin::ExecutorBehavior (module)">ExecutorBehavior</a></span></dd>
|
77
|
-
</dl>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
<dl>
|
83
|
-
<dt>Included in:</dt>
|
84
|
-
<dd><span class='object_link'><a href="Seeder.html" title="AeEasy::Core::Plugin::Seeder (module)">Seeder</a></span></dd>
|
85
|
-
</dl>
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
<dl>
|
90
|
-
<dt>Defined in:</dt>
|
91
|
-
<dd>lib/ae_easy/core/plugin/seeder_behavior.rb</dd>
|
92
|
-
</dl>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<h2>Instance Attribute Summary</h2>
|
103
|
-
|
104
|
-
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ContextIntegrator.html" title="AeEasy::Core::Plugin::ContextIntegrator (module)">ContextIntegrator</a></span></h3>
|
105
|
-
<p class="inherited"><span class='object_link'><a href="ContextIntegrator.html#context-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#context (method)">#context</a></span></p>
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<h2>Method Summary</h2>
|
116
|
-
|
117
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="ExecutorBehavior.html" title="AeEasy::Core::Plugin::ExecutorBehavior (module)">ExecutorBehavior</a></span></h3>
|
118
|
-
<p class="inherited"><span class='object_link'><a href="ExecutorBehavior.html#enqueue-instance_method" title="AeEasy::Core::Plugin::ExecutorBehavior#enqueue (method)">#enqueue</a></span>, <span class='object_link'><a href="ExecutorBehavior.html#save-instance_method" title="AeEasy::Core::Plugin::ExecutorBehavior#save (method)">#save</a></span></p>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="ContextIntegrator.html" title="AeEasy::Core::Plugin::ContextIntegrator (module)">ContextIntegrator</a></span></h3>
|
129
|
-
<p class="inherited"><span class='object_link'><a href="ContextIntegrator.html#initialize_hook_core_context_integrator-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#initialize_hook_core_context_integrator (method)">#initialize_hook_core_context_integrator</a></span>, <span class='object_link'><a href="ContextIntegrator.html#mock_context-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#mock_context (method)">#mock_context</a></span></p>
|
130
|
-
|
131
|
-
|
132
|
-
</div>
|
133
|
-
|
134
|
-
<div id="footer">
|
135
|
-
Generated on
|
136
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
137
|
-
0.9.
|
138
|
-
</div>
|
139
|
-
|
140
|
-
</div>
|
141
|
-
</body>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: AeEasy::Core::Plugin::SeederBehavior
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "AeEasy::Core::Plugin::SeederBehavior";
|
19
|
+
relpath = '../../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span> » <span class='title'><span class='object_link'><a href="../../Core.html" title="AeEasy::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../Plugin.html" title="AeEasy::Core::Plugin (module)">Plugin</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">SeederBehavior</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: AeEasy::Core::Plugin::SeederBehavior
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dl>
|
75
|
+
<dt>Includes:</dt>
|
76
|
+
<dd><span class='object_link'><a href="ExecutorBehavior.html" title="AeEasy::Core::Plugin::ExecutorBehavior (module)">ExecutorBehavior</a></span></dd>
|
77
|
+
</dl>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dl>
|
83
|
+
<dt>Included in:</dt>
|
84
|
+
<dd><span class='object_link'><a href="Seeder.html" title="AeEasy::Core::Plugin::Seeder (module)">Seeder</a></span></dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dl>
|
90
|
+
<dt>Defined in:</dt>
|
91
|
+
<dd>lib/ae_easy/core/plugin/seeder_behavior.rb</dd>
|
92
|
+
</dl>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<h2>Instance Attribute Summary</h2>
|
103
|
+
|
104
|
+
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ContextIntegrator.html" title="AeEasy::Core::Plugin::ContextIntegrator (module)">ContextIntegrator</a></span></h3>
|
105
|
+
<p class="inherited"><span class='object_link'><a href="ContextIntegrator.html#context-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#context (method)">#context</a></span></p>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<h2>Method Summary</h2>
|
116
|
+
|
117
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="ExecutorBehavior.html" title="AeEasy::Core::Plugin::ExecutorBehavior (module)">ExecutorBehavior</a></span></h3>
|
118
|
+
<p class="inherited"><span class='object_link'><a href="ExecutorBehavior.html#enqueue-instance_method" title="AeEasy::Core::Plugin::ExecutorBehavior#enqueue (method)">#enqueue</a></span>, <span class='object_link'><a href="ExecutorBehavior.html#save-instance_method" title="AeEasy::Core::Plugin::ExecutorBehavior#save (method)">#save</a></span></p>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="ContextIntegrator.html" title="AeEasy::Core::Plugin::ContextIntegrator (module)">ContextIntegrator</a></span></h3>
|
129
|
+
<p class="inherited"><span class='object_link'><a href="ContextIntegrator.html#initialize_hook_core_context_integrator-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#initialize_hook_core_context_integrator (method)">#initialize_hook_core_context_integrator</a></span>, <span class='object_link'><a href="ContextIntegrator.html#mock_context-instance_method" title="AeEasy::Core::Plugin::ContextIntegrator#mock_context (method)">#mock_context</a></span></p>
|
130
|
+
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div id="footer">
|
135
|
+
Generated on Fri Sep 27 02:01:31 2019 by
|
136
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
137
|
+
0.9.20 (ruby-2.5.3).
|
138
|
+
</div>
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</body>
|
142
142
|
</html>
|
@@ -1,394 +1,394 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: AeEasy::Core::SmartCollection
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "AeEasy::Core::SmartCollection";
|
19
|
-
relpath = '../../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span> » <span class='title'><span class='object_link'><a href="../Core.html" title="AeEasy::Core (module)">Core</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">SmartCollection</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: AeEasy::Core::SmartCollection
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Array</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">Array</li>
|
78
|
-
|
79
|
-
<li class="next">AeEasy::Core::SmartCollection</li>
|
80
|
-
|
81
|
-
</ul>
|
82
|
-
<a href="#" class="inheritanceTree">show all</a>
|
83
|
-
|
84
|
-
</dd>
|
85
|
-
</dl>
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<dl>
|
98
|
-
<dt>Defined in:</dt>
|
99
|
-
<dd>lib/ae_easy/core/smart_collection.rb</dd>
|
100
|
-
</dl>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<h2>Overview</h2><div class="docstring">
|
105
|
-
<div class="discussion">
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: AeEasy::Core::SmartCollection
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "AeEasy::Core::SmartCollection";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span> » <span class='title'><span class='object_link'><a href="../Core.html" title="AeEasy::Core (module)">Core</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">SmartCollection</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: AeEasy::Core::SmartCollection
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Array</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Array</li>
|
78
|
+
|
79
|
+
<li class="next">AeEasy::Core::SmartCollection</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/ae_easy/core/smart_collection.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
106
|
|
107
107
|
<p>Smart collection capable to avoid duplicates on insert by matching id</p>
|
108
108
|
|
109
109
|
<pre class="code ruby"><code class="ruby">defined fields along events.
|
110
110
|
</code></pre>
|
111
|
-
|
112
|
-
|
113
|
-
</div>
|
114
|
-
</div>
|
115
|
-
<div class="tags">
|
116
|
-
|
117
|
-
|
118
|
-
</div>
|
119
|
-
|
120
|
-
<h2>
|
121
|
-
Constant Summary
|
122
|
-
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
123
|
-
</h2>
|
124
|
-
|
125
|
-
<dl class="constants">
|
126
|
-
|
127
|
-
<dt id="EVENTS-constant" class="">EVENTS =
|
128
|
-
<div class="docstring">
|
129
|
-
<div class="discussion">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="tags">
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<h2>
|
121
|
+
Constant Summary
|
122
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
123
|
+
</h2>
|
124
|
+
|
125
|
+
<dl class="constants">
|
126
|
+
|
127
|
+
<dt id="EVENTS-constant" class="">EVENTS =
|
128
|
+
<div class="docstring">
|
129
|
+
<div class="discussion">
|
130
130
|
|
131
131
|
<p>Implemented event list.</p>
|
132
|
-
|
133
|
-
|
134
|
-
</div>
|
135
|
-
</div>
|
136
|
-
<div class="tags">
|
137
|
-
|
138
|
-
|
139
|
-
</div>
|
140
|
-
</dt>
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
<div class="tags">
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
</dt>
|
141
141
|
<dd><pre class="code"><span class='lbracket'>[</span>
|
142
142
|
<span class='symbol'>:before_defaults</span><span class='comma'>,</span>
|
143
143
|
<span class='symbol'>:before_match</span><span class='comma'>,</span>
|
144
144
|
<span class='symbol'>:before_insert</span><span class='comma'>,</span>
|
145
145
|
<span class='symbol'>:after_insert</span>
|
146
|
-
<span class='rbracket'>]</span></pre></dd>
|
147
|
-
|
148
|
-
</dl>
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
155
|
-
<ul class="summary">
|
156
|
-
|
157
|
-
<li class="public ">
|
158
|
-
<span class="summary_signature">
|
159
|
-
|
160
|
-
<a href="#defaults-instance_method" title="#defaults (instance method)">#<strong>defaults</strong> ⇒ Object </a>
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
</span>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
<span class="note title readonly">readonly</span>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
146
|
+
<span class='rbracket'>]</span></pre></dd>
|
147
|
+
|
148
|
+
</dl>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
155
|
+
<ul class="summary">
|
156
|
+
|
157
|
+
<li class="public ">
|
158
|
+
<span class="summary_signature">
|
159
|
+
|
160
|
+
<a href="#defaults-instance_method" title="#defaults (instance method)">#<strong>defaults</strong> ⇒ Object </a>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="note title readonly">readonly</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
179
|
<span class="summary_desc"><div class='inline'>
|
180
180
|
<p>Default fields values.</p>
|
181
|
-
</div></span>
|
182
|
-
|
183
|
-
</li>
|
184
|
-
|
185
|
-
|
186
|
-
<li class="public ">
|
187
|
-
<span class="summary_signature">
|
188
|
-
|
189
|
-
<a href="#key_fields-instance_method" title="#key_fields (instance method)">#<strong>key_fields</strong> ⇒ Object </a>
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
</span>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
<span class="note title readonly">readonly</span>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
181
|
+
</div></span>
|
182
|
+
|
183
|
+
</li>
|
184
|
+
|
185
|
+
|
186
|
+
<li class="public ">
|
187
|
+
<span class="summary_signature">
|
188
|
+
|
189
|
+
<a href="#key_fields-instance_method" title="#key_fields (instance method)">#<strong>key_fields</strong> ⇒ Object </a>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</span>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="note title readonly">readonly</span>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
208
|
<span class="summary_desc"><div class='inline'>
|
209
209
|
<p>Key fields, analog to primary keys.</p>
|
210
|
-
</div></span>
|
211
|
-
|
212
|
-
</li>
|
213
|
-
|
214
|
-
|
215
|
-
</ul>
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
<h2>
|
222
|
-
Instance Method Summary
|
223
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
224
|
-
</h2>
|
225
|
-
|
226
|
-
<ul class="summary">
|
227
|
-
|
228
|
-
<li class="public ">
|
229
|
-
<span class="summary_signature">
|
230
|
-
|
231
|
-
<a href="#<<-instance_method" title="#<< (instance method)">#<strong><<</strong>(item) ⇒ Object </a>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</span>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
210
|
+
</div></span>
|
211
|
+
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
</ul>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<h2>
|
222
|
+
Instance Method Summary
|
223
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
224
|
+
</h2>
|
225
|
+
|
226
|
+
<ul class="summary">
|
227
|
+
|
228
|
+
<li class="public ">
|
229
|
+
<span class="summary_signature">
|
230
|
+
|
231
|
+
<a href="#<<-instance_method" title="#<< (instance method)">#<strong><<</strong>(item) ⇒ Object </a>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
245
|
<span class="summary_desc"><div class='inline'>
|
246
246
|
<p>Add/remplace an item avoiding duplicates.</p>
|
247
|
-
</div></span>
|
248
|
-
|
249
|
-
</li>
|
250
|
-
|
251
|
-
|
252
|
-
<li class="public ">
|
253
|
-
<span class="summary_signature">
|
254
|
-
|
255
|
-
<a href="#bind_event-instance_method" title="#bind_event (instance method)">#<strong>bind_event</strong>(key, &block) ⇒ Object </a>
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
</span>
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
247
|
+
</div></span>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
|
252
|
+
<li class="public ">
|
253
|
+
<span class="summary_signature">
|
254
|
+
|
255
|
+
<a href="#bind_event-instance_method" title="#bind_event (instance method)">#<strong>bind_event</strong>(key, &block) ⇒ Object </a>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</span>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
269
|
<span class="summary_desc"><div class='inline'>
|
270
270
|
<p>Add event binding by key and block.</p>
|
271
|
-
</div></span>
|
272
|
-
|
273
|
-
</li>
|
274
|
-
|
275
|
-
|
276
|
-
<li class="public ">
|
277
|
-
<span class="summary_signature">
|
278
|
-
|
279
|
-
<a href="#find_match-instance_method" title="#find_match (instance method)">#<strong>find_match</strong>(filter) ⇒ Hash<sup>?</sup> </a>
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
</span>
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
271
|
+
</div></span>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
|
276
|
+
<li class="public ">
|
277
|
+
<span class="summary_signature">
|
278
|
+
|
279
|
+
<a href="#find_match-instance_method" title="#find_match (instance method)">#<strong>find_match</strong>(filter) ⇒ Hash<sup>?</sup> </a>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</span>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
293
|
<span class="summary_desc"><div class='inline'>
|
294
294
|
<p>Find an item by matching filter keys.</p>
|
295
|
-
</div></span>
|
296
|
-
|
297
|
-
</li>
|
298
|
-
|
299
|
-
|
300
|
-
<li class="public ">
|
301
|
-
<span class="summary_signature">
|
302
|
-
|
303
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(key_fields, opts = {}) ⇒ SmartCollection </a>
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
</span>
|
308
|
-
|
309
|
-
|
310
|
-
<span class="note title constructor">constructor</span>
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
295
|
+
</div></span>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li class="public ">
|
301
|
+
<span class="summary_signature">
|
302
|
+
|
303
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(key_fields, opts = {}) ⇒ SmartCollection </a>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</span>
|
308
|
+
|
309
|
+
|
310
|
+
<span class="note title constructor">constructor</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
319
|
<span class="summary_desc"><div class='inline'>
|
320
320
|
<p>Initialize collection.</p>
|
321
|
-
</div></span>
|
322
|
-
|
323
|
-
</li>
|
324
|
-
|
325
|
-
|
326
|
-
<li class="public ">
|
327
|
-
<span class="summary_signature">
|
328
|
-
|
329
|
-
<a href="#match_keys%3F-instance_method" title="#match_keys? (instance method)">#<strong>match_keys?</strong>(item_a, item_b) ⇒ Boolean </a>
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
</span>
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
321
|
+
</div></span>
|
322
|
+
|
323
|
+
</li>
|
324
|
+
|
325
|
+
|
326
|
+
<li class="public ">
|
327
|
+
<span class="summary_signature">
|
328
|
+
|
329
|
+
<a href="#match_keys%3F-instance_method" title="#match_keys? (instance method)">#<strong>match_keys?</strong>(item_a, item_b) ⇒ Boolean </a>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
</span>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
343
|
<span class="summary_desc"><div class='inline'>
|
344
344
|
<p>Check whenever two items keys match.</p>
|
345
|
-
</div></span>
|
346
|
-
|
347
|
-
</li>
|
348
|
-
|
349
|
-
|
350
|
-
</ul>
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
<div id="constructor_details" class="method_details_list">
|
355
|
-
<h2>Constructor Details</h2>
|
356
|
-
|
357
|
-
<div class="method_details first">
|
358
|
-
<h3 class="signature first" id="initialize-instance_method">
|
359
|
-
|
360
|
-
#<strong>initialize</strong>(key_fields, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="AeEasy::Core::SmartCollection (class)">SmartCollection</a></span></tt>
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
</h3><div class="docstring">
|
367
|
-
<div class="discussion">
|
368
|
-
|
369
|
-
<div class="note notetag">
|
370
|
-
<strong>Note:</strong>
|
345
|
+
</div></span>
|
346
|
+
|
347
|
+
</li>
|
348
|
+
|
349
|
+
|
350
|
+
</ul>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
<div id="constructor_details" class="method_details_list">
|
355
|
+
<h2>Constructor Details</h2>
|
356
|
+
|
357
|
+
<div class="method_details first">
|
358
|
+
<h3 class="signature first" id="initialize-instance_method">
|
359
|
+
|
360
|
+
#<strong>initialize</strong>(key_fields, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="AeEasy::Core::SmartCollection (class)">SmartCollection</a></span></tt>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
</h3><div class="docstring">
|
367
|
+
<div class="discussion">
|
368
|
+
|
369
|
+
<div class="note notetag">
|
370
|
+
<strong>Note:</strong>
|
371
371
|
<div class='inline'>
|
372
372
|
<p>Defaults will apply to missing fields and null values only.</p>
|
373
|
-
</div>
|
374
|
-
</div>
|
375
|
-
|
373
|
+
</div>
|
374
|
+
</div>
|
375
|
+
|
376
376
|
|
377
377
|
<p>Initialize collection</p>
|
378
|
-
|
379
|
-
|
380
|
-
</div>
|
381
|
-
</div>
|
382
|
-
<div class="tags">
|
383
|
-
|
384
|
-
<div class="examples">
|
385
|
-
<p class="tag_title">Examples:</p>
|
386
|
-
|
387
|
-
|
378
|
+
|
379
|
+
|
380
|
+
</div>
|
381
|
+
</div>
|
382
|
+
<div class="tags">
|
383
|
+
|
384
|
+
<div class="examples">
|
385
|
+
<p class="tag_title">Examples:</p>
|
386
|
+
|
387
|
+
|
388
388
|
<p class="example_title"><div class='inline'>
|
389
389
|
<p>With default values.</p>
|
390
|
-
</div></p>
|
391
|
-
|
390
|
+
</div></p>
|
391
|
+
|
392
392
|
<pre class="example code"><code><span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>0</span>
|
393
393
|
<span class='id identifier rubyid_defaults'>defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
394
394
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>+=</span> <span class='int'>1</span><span class='rbrace'>}</span><span class='comma'>,</span>
|
@@ -409,95 +409,95 @@
|
|
409
409
|
</span><span class='comment'># {'id' => 2, 'aaa' => 111, 'bbb' => 'Has ccc', 'ccc' => 'ddd'},
|
410
410
|
</span><span class='comment'># {'id' => 'abc123', 'aaa' => 111, 'bbb' => 'No ccc'},
|
411
411
|
</span><span class='comment'># {'id' => 3, 'aaa' => 111, 'bbb' => 'Look mom! no ccc'}
|
412
|
-
</span><span class='comment'># ]</span></code></pre>
|
413
|
-
|
414
|
-
</div>
|
415
|
-
<p class="tag_title">Parameters:</p>
|
416
|
-
<ul class="param">
|
417
|
-
|
418
|
-
<li>
|
419
|
-
|
420
|
-
<span class='name'>key_fields</span>
|
421
|
-
|
422
|
-
|
423
|
-
<span class='type'>(<tt>Array</tt>)</span>
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
—
|
412
|
+
</span><span class='comment'># ]</span></code></pre>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
<p class="tag_title">Parameters:</p>
|
416
|
+
<ul class="param">
|
417
|
+
|
418
|
+
<li>
|
419
|
+
|
420
|
+
<span class='name'>key_fields</span>
|
421
|
+
|
422
|
+
|
423
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
—
|
428
428
|
<div class='inline'>
|
429
429
|
<p>Key fields, analog to primary keys.</p>
|
430
|
-
</div>
|
431
|
-
|
432
|
-
</li>
|
433
|
-
|
434
|
-
<li>
|
435
|
-
|
436
|
-
<span class='name'>opts</span>
|
437
|
-
|
438
|
-
|
439
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
440
|
-
|
441
|
-
|
442
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
443
|
-
|
444
|
-
|
445
|
-
—
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</li>
|
433
|
+
|
434
|
+
<li>
|
435
|
+
|
436
|
+
<span class='name'>opts</span>
|
437
|
+
|
438
|
+
|
439
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
440
|
+
|
441
|
+
|
442
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
443
|
+
|
444
|
+
|
445
|
+
—
|
446
446
|
<div class='inline'>
|
447
447
|
<p>({}) Configuration options.</p>
|
448
|
-
</div>
|
449
|
-
|
450
|
-
</li>
|
451
|
-
|
452
|
-
</ul>
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
460
|
-
<ul class="option">
|
461
|
-
|
462
|
-
<li>
|
463
|
-
<span class="name">:values</span>
|
464
|
-
<span class="type">(<tt>Array</tt>)</span>
|
465
|
-
<span class="default">
|
466
|
-
|
467
|
-
— default:
|
468
|
-
<tt>[]</tt>
|
469
|
-
|
470
|
-
</span>
|
471
|
-
|
448
|
+
</div>
|
449
|
+
|
450
|
+
</li>
|
451
|
+
|
452
|
+
</ul>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
460
|
+
<ul class="option">
|
461
|
+
|
462
|
+
<li>
|
463
|
+
<span class="name">:values</span>
|
464
|
+
<span class="type">(<tt>Array</tt>)</span>
|
465
|
+
<span class="default">
|
466
|
+
|
467
|
+
— default:
|
468
|
+
<tt>[]</tt>
|
469
|
+
|
470
|
+
</span>
|
471
|
+
|
472
472
|
— <div class='inline'>
|
473
473
|
<p>Initial values; will avoid duplicates on insert.</p>
|
474
|
-
</div>
|
475
|
-
|
476
|
-
</li>
|
477
|
-
|
478
|
-
<li>
|
479
|
-
<span class="name">:defaults</span>
|
480
|
-
<span class="type">(<tt>Hash</tt>)</span>
|
481
|
-
<span class="default">
|
482
|
-
|
483
|
-
— default:
|
484
|
-
<tt>{}</tt>
|
485
|
-
|
486
|
-
</span>
|
487
|
-
|
474
|
+
</div>
|
475
|
+
|
476
|
+
</li>
|
477
|
+
|
478
|
+
<li>
|
479
|
+
<span class="name">:defaults</span>
|
480
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
481
|
+
<span class="default">
|
482
|
+
|
483
|
+
— default:
|
484
|
+
<tt>{}</tt>
|
485
|
+
|
486
|
+
</span>
|
487
|
+
|
488
488
|
— <div class='inline'>
|
489
489
|
<p>Default values. `proc` values will be executed to get default value.</p>
|
490
|
-
</div>
|
491
|
-
|
492
|
-
</li>
|
493
|
-
|
494
|
-
</ul>
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
</div><table class="source_code">
|
499
|
-
<tr>
|
500
|
-
<td>
|
490
|
+
</div>
|
491
|
+
|
492
|
+
</li>
|
493
|
+
|
494
|
+
</ul>
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
</div><table class="source_code">
|
499
|
+
<tr>
|
500
|
+
<td>
|
501
501
|
<pre class="lines">
|
502
502
|
|
503
503
|
|
@@ -506,9 +506,9 @@
|
|
506
506
|
52
|
507
507
|
53
|
508
508
|
54
|
509
|
-
55</pre>
|
510
|
-
</td>
|
511
|
-
<td>
|
509
|
+
55</pre>
|
510
|
+
</td>
|
511
|
+
<td>
|
512
512
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 50</span>
|
513
513
|
|
514
514
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_key_fields'>key_fields</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -516,133 +516,133 @@
|
|
516
516
|
<span class='ivar'>@defaults</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:defaults</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
517
517
|
<span class='kw'>super</span> <span class='int'>0</span>
|
518
518
|
<span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:values</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span> <span class='kw'>self</span> <span class='op'><<</span> <span class='id identifier rubyid_item'>item</span><span class='rbrace'>}</span>
|
519
|
-
<span class='kw'>end</span></pre>
|
520
|
-
</td>
|
521
|
-
</tr>
|
522
|
-
</table>
|
523
|
-
</div>
|
524
|
-
|
525
|
-
</div>
|
526
|
-
|
527
|
-
<div id="instance_attr_details" class="attr_details">
|
528
|
-
<h2>Instance Attribute Details</h2>
|
529
|
-
|
530
|
-
|
531
|
-
<span id=""></span>
|
532
|
-
<div class="method_details first">
|
533
|
-
<h3 class="signature first" id="defaults-instance_method">
|
534
|
-
|
535
|
-
#<strong>defaults</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
</h3><div class="docstring">
|
542
|
-
<div class="discussion">
|
519
|
+
<span class='kw'>end</span></pre>
|
520
|
+
</td>
|
521
|
+
</tr>
|
522
|
+
</table>
|
523
|
+
</div>
|
524
|
+
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div id="instance_attr_details" class="attr_details">
|
528
|
+
<h2>Instance Attribute Details</h2>
|
529
|
+
|
530
|
+
|
531
|
+
<span id=""></span>
|
532
|
+
<div class="method_details first">
|
533
|
+
<h3 class="signature first" id="defaults-instance_method">
|
534
|
+
|
535
|
+
#<strong>defaults</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
</h3><div class="docstring">
|
542
|
+
<div class="discussion">
|
543
543
|
|
544
544
|
<p>Default fields values. Apply to missing fields and null values.</p>
|
545
|
-
|
546
|
-
|
547
|
-
</div>
|
548
|
-
</div>
|
549
|
-
<div class="tags">
|
550
|
-
|
551
|
-
|
552
|
-
</div><table class="source_code">
|
553
|
-
<tr>
|
554
|
-
<td>
|
545
|
+
|
546
|
+
|
547
|
+
</div>
|
548
|
+
</div>
|
549
|
+
<div class="tags">
|
550
|
+
|
551
|
+
|
552
|
+
</div><table class="source_code">
|
553
|
+
<tr>
|
554
|
+
<td>
|
555
555
|
<pre class="lines">
|
556
556
|
|
557
557
|
|
558
558
|
17
|
559
559
|
18
|
560
|
-
19</pre>
|
561
|
-
</td>
|
562
|
-
<td>
|
560
|
+
19</pre>
|
561
|
+
</td>
|
562
|
+
<td>
|
563
563
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 17</span>
|
564
564
|
|
565
565
|
<span class='kw'>def</span> <span class='id identifier rubyid_defaults'>defaults</span>
|
566
566
|
<span class='ivar'>@defaults</span>
|
567
|
-
<span class='kw'>end</span></pre>
|
568
|
-
</td>
|
569
|
-
</tr>
|
570
|
-
</table>
|
571
|
-
</div>
|
572
|
-
|
573
|
-
|
574
|
-
<span id=""></span>
|
575
|
-
<div class="method_details ">
|
576
|
-
<h3 class="signature " id="key_fields-instance_method">
|
577
|
-
|
578
|
-
#<strong>key_fields</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
</h3><div class="docstring">
|
585
|
-
<div class="discussion">
|
567
|
+
<span class='kw'>end</span></pre>
|
568
|
+
</td>
|
569
|
+
</tr>
|
570
|
+
</table>
|
571
|
+
</div>
|
572
|
+
|
573
|
+
|
574
|
+
<span id=""></span>
|
575
|
+
<div class="method_details ">
|
576
|
+
<h3 class="signature " id="key_fields-instance_method">
|
577
|
+
|
578
|
+
#<strong>key_fields</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
</h3><div class="docstring">
|
585
|
+
<div class="discussion">
|
586
586
|
|
587
587
|
<p>Key fields, analog to primary keys.</p>
|
588
|
-
|
589
|
-
|
590
|
-
</div>
|
591
|
-
</div>
|
592
|
-
<div class="tags">
|
593
|
-
|
594
|
-
|
595
|
-
</div><table class="source_code">
|
596
|
-
<tr>
|
597
|
-
<td>
|
588
|
+
|
589
|
+
|
590
|
+
</div>
|
591
|
+
</div>
|
592
|
+
<div class="tags">
|
593
|
+
|
594
|
+
|
595
|
+
</div><table class="source_code">
|
596
|
+
<tr>
|
597
|
+
<td>
|
598
598
|
<pre class="lines">
|
599
599
|
|
600
600
|
|
601
601
|
15
|
602
602
|
16
|
603
|
-
17</pre>
|
604
|
-
</td>
|
605
|
-
<td>
|
603
|
+
17</pre>
|
604
|
+
</td>
|
605
|
+
<td>
|
606
606
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 15</span>
|
607
607
|
|
608
608
|
<span class='kw'>def</span> <span class='id identifier rubyid_key_fields'>key_fields</span>
|
609
609
|
<span class='ivar'>@key_fields</span>
|
610
|
-
<span class='kw'>end</span></pre>
|
611
|
-
</td>
|
612
|
-
</tr>
|
613
|
-
</table>
|
614
|
-
</div>
|
615
|
-
|
616
|
-
</div>
|
617
|
-
|
618
|
-
|
619
|
-
<div id="instance_method_details" class="method_details_list">
|
620
|
-
<h2>Instance Method Details</h2>
|
621
|
-
|
622
|
-
|
623
|
-
<div class="method_details first">
|
624
|
-
<h3 class="signature first" id="<<-instance_method">
|
625
|
-
|
626
|
-
#<strong><<</strong>(item) ⇒ <tt>Object</tt>
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
</h3><div class="docstring">
|
633
|
-
<div class="discussion">
|
610
|
+
<span class='kw'>end</span></pre>
|
611
|
+
</td>
|
612
|
+
</tr>
|
613
|
+
</table>
|
614
|
+
</div>
|
615
|
+
|
616
|
+
</div>
|
617
|
+
|
618
|
+
|
619
|
+
<div id="instance_method_details" class="method_details_list">
|
620
|
+
<h2>Instance Method Details</h2>
|
621
|
+
|
622
|
+
|
623
|
+
<div class="method_details first">
|
624
|
+
<h3 class="signature first" id="<<-instance_method">
|
625
|
+
|
626
|
+
#<strong><<</strong>(item) ⇒ <tt>Object</tt>
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
</h3><div class="docstring">
|
633
|
+
<div class="discussion">
|
634
634
|
|
635
635
|
<p>Add/remplace an item avoiding duplicates</p>
|
636
|
-
|
637
|
-
|
638
|
-
</div>
|
639
|
-
</div>
|
640
|
-
<div class="tags">
|
641
|
-
|
642
|
-
|
643
|
-
</div><table class="source_code">
|
644
|
-
<tr>
|
645
|
-
<td>
|
636
|
+
|
637
|
+
|
638
|
+
</div>
|
639
|
+
</div>
|
640
|
+
<div class="tags">
|
641
|
+
|
642
|
+
|
643
|
+
</div><table class="source_code">
|
644
|
+
<tr>
|
645
|
+
<td>
|
646
646
|
<pre class="lines">
|
647
647
|
|
648
648
|
|
@@ -655,9 +655,9 @@
|
|
655
655
|
230
|
656
656
|
231
|
657
657
|
232
|
658
|
-
233</pre>
|
659
|
-
</td>
|
660
|
-
<td>
|
658
|
+
233</pre>
|
659
|
+
</td>
|
660
|
+
<td>
|
661
661
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 224</span>
|
662
662
|
|
663
663
|
<span class='kw'>def</span> <span class='op'><<</span> <span class='id identifier rubyid_item'>item</span>
|
@@ -669,26 +669,26 @@
|
|
669
669
|
<span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_match'>match</span> <span class='kw'>unless</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
670
670
|
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
671
671
|
<span class='id identifier rubyid_call_event'>call_event</span> <span class='symbol'>:after_insert</span><span class='comma'>,</span> <span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_item'>item</span><span class='comma'>,</span> <span class='id identifier rubyid_match'>match</span>
|
672
|
-
<span class='kw'>end</span></pre>
|
673
|
-
</td>
|
674
|
-
</tr>
|
675
|
-
</table>
|
676
|
-
</div>
|
677
|
-
|
678
|
-
<div class="method_details ">
|
679
|
-
<h3 class="signature " id="bind_event-instance_method">
|
680
|
-
|
681
|
-
#<strong>bind_event</strong>(key, &block) ⇒ <tt>Object</tt>
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
</h3><div class="docstring">
|
688
|
-
<div class="discussion">
|
689
|
-
|
690
|
-
<div class="note notetag">
|
691
|
-
<strong>Note:</strong>
|
672
|
+
<span class='kw'>end</span></pre>
|
673
|
+
</td>
|
674
|
+
</tr>
|
675
|
+
</table>
|
676
|
+
</div>
|
677
|
+
|
678
|
+
<div class="method_details ">
|
679
|
+
<h3 class="signature " id="bind_event-instance_method">
|
680
|
+
|
681
|
+
#<strong>bind_event</strong>(key, &block) ⇒ <tt>Object</tt>
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
</h3><div class="docstring">
|
688
|
+
<div class="discussion">
|
689
|
+
|
690
|
+
<div class="note notetag">
|
691
|
+
<strong>Note:</strong>
|
692
692
|
<div class='inline'>
|
693
693
|
<p>Some events will expect a return value to replace item on insertion:</p>
|
694
694
|
<ul><li>
|
@@ -698,25 +698,25 @@
|
|
698
698
|
</li><li>
|
699
699
|
<p>`before_insert`</p>
|
700
700
|
</li></ul>
|
701
|
-
</div>
|
702
|
-
</div>
|
703
|
-
|
701
|
+
</div>
|
702
|
+
</div>
|
703
|
+
|
704
704
|
|
705
705
|
<p>Add event binding by key and block.</p>
|
706
|
-
|
707
|
-
|
708
|
-
</div>
|
709
|
-
</div>
|
710
|
-
<div class="tags">
|
711
|
-
|
712
|
-
<div class="examples">
|
713
|
-
<p class="tag_title">Examples:</p>
|
714
|
-
|
715
|
-
|
706
|
+
|
707
|
+
|
708
|
+
</div>
|
709
|
+
</div>
|
710
|
+
<div class="tags">
|
711
|
+
|
712
|
+
<div class="examples">
|
713
|
+
<p class="tag_title">Examples:</p>
|
714
|
+
|
715
|
+
|
716
716
|
<p class="example_title"><div class='inline'>
|
717
717
|
<p>before_defaults</p>
|
718
|
-
</div></p>
|
719
|
-
|
718
|
+
</div></p>
|
719
|
+
|
720
720
|
<pre class="example code"><code><span class='id identifier rubyid_defaults'>defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>aaa</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='int'>111</span><span class='rbrace'>}</span>
|
721
721
|
<span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="AeEasy::Core::SmartCollection (class)">SmartCollection</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="AeEasy::Core::SmartCollection#initialize (method)">new</a></span></span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
722
722
|
<span class='label'>defaults:</span> <span class='id identifier rubyid_defaults'>defaults</span>
|
@@ -732,13 +732,13 @@
|
|
732
732
|
<span class='kw'>end</span>
|
733
733
|
<span class='id identifier rubyid_data'>data</span> <span class='op'><<</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bbb</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='int'>222</span><span class='rbrace'>}</span>
|
734
734
|
<span class='id identifier rubyid_data'>data</span>
|
735
|
-
<span class='comment'># => [{'aaa' => 111, 'bbb' => 222}]</span></code></pre>
|
736
|
-
|
737
|
-
|
735
|
+
<span class='comment'># => [{'aaa' => 111, 'bbb' => 222}]</span></code></pre>
|
736
|
+
|
737
|
+
|
738
738
|
<p class="example_title"><div class='inline'>
|
739
739
|
<p>before_match</p>
|
740
|
-
</div></p>
|
741
|
-
|
740
|
+
</div></p>
|
741
|
+
|
742
742
|
<pre class="example code"><code>keys = ['id']
|
743
743
|
defaults = {'aaa' => 111}
|
744
744
|
values = [
|
@@ -759,13 +759,13 @@ collection.bind_event(:before_match) do |collection, item|
|
|
759
759
|
end
|
760
760
|
data << {'id' => 1, 'bbb' => 222}
|
761
761
|
data
|
762
|
-
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
763
|
-
|
764
|
-
|
762
|
+
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
763
|
+
|
764
|
+
|
765
765
|
<p class="example_title"><div class='inline'>
|
766
766
|
<p>before_insert</p>
|
767
|
-
</div></p>
|
768
|
-
|
767
|
+
</div></p>
|
768
|
+
|
769
769
|
<pre class="example code"><code>keys = ['id']
|
770
770
|
defaults = {'aaa' => 111}
|
771
771
|
values = [
|
@@ -788,13 +788,13 @@ collection.bind_event(:before_insert) do |collection, item, match|
|
|
788
788
|
end
|
789
789
|
data << {'id' => 1, 'bbb' => 222}
|
790
790
|
data
|
791
|
-
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
792
|
-
|
793
|
-
|
791
|
+
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
792
|
+
|
793
|
+
|
794
794
|
<p class="example_title"><div class='inline'>
|
795
795
|
<p>after_insert</p>
|
796
|
-
</div></p>
|
797
|
-
|
796
|
+
</div></p>
|
797
|
+
|
798
798
|
<pre class="example code"><code>keys = ['id']
|
799
799
|
defaults = {'aaa' => 111}
|
800
800
|
values = [
|
@@ -814,52 +814,52 @@ collection.bind_event(:after_insert) do |collection, item, match|
|
|
814
814
|
end
|
815
815
|
data << {'id' => 1, 'bbb' => 222}
|
816
816
|
data
|
817
|
-
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
818
|
-
|
819
|
-
</div>
|
820
|
-
<p class="tag_title">Parameters:</p>
|
821
|
-
<ul class="param">
|
822
|
-
|
823
|
-
<li>
|
824
|
-
|
825
|
-
<span class='name'>key</span>
|
826
|
-
|
827
|
-
|
828
|
-
<span class='type'>(<tt>Symbol</tt>)</span>
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
—
|
817
|
+
# => [{'id' => 1, 'aaa' => 111, 'bbb' => 222}]</code></pre>
|
818
|
+
|
819
|
+
</div>
|
820
|
+
<p class="tag_title">Parameters:</p>
|
821
|
+
<ul class="param">
|
822
|
+
|
823
|
+
<li>
|
824
|
+
|
825
|
+
<span class='name'>key</span>
|
826
|
+
|
827
|
+
|
828
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
—
|
833
833
|
<div class='inline'>
|
834
834
|
<p>Event name.</p>
|
835
|
-
</div>
|
836
|
-
|
837
|
-
</li>
|
838
|
-
|
839
|
-
</ul>
|
840
|
-
|
841
|
-
<p class="tag_title">Raises:</p>
|
842
|
-
<ul class="raise">
|
843
|
-
|
844
|
-
<li>
|
845
|
-
|
846
|
-
|
847
|
-
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
—
|
835
|
+
</div>
|
836
|
+
|
837
|
+
</li>
|
838
|
+
|
839
|
+
</ul>
|
840
|
+
|
841
|
+
<p class="tag_title">Raises:</p>
|
842
|
+
<ul class="raise">
|
843
|
+
|
844
|
+
<li>
|
845
|
+
|
846
|
+
|
847
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
—
|
852
852
|
<div class='inline'>
|
853
853
|
<p>When unknown event key.</p>
|
854
|
-
</div>
|
855
|
-
|
856
|
-
</li>
|
857
|
-
|
858
|
-
</ul>
|
859
|
-
|
860
|
-
</div><table class="source_code">
|
861
|
-
<tr>
|
862
|
-
<td>
|
854
|
+
</div>
|
855
|
+
|
856
|
+
</li>
|
857
|
+
|
858
|
+
</ul>
|
859
|
+
|
860
|
+
</div><table class="source_code">
|
861
|
+
<tr>
|
862
|
+
<td>
|
863
863
|
<pre class="lines">
|
864
864
|
|
865
865
|
|
@@ -868,9 +868,9 @@ data
|
|
868
868
|
163
|
869
869
|
164
|
870
870
|
165
|
871
|
-
166</pre>
|
872
|
-
</td>
|
873
|
-
<td>
|
871
|
+
166</pre>
|
872
|
+
</td>
|
873
|
+
<td>
|
874
874
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 161</span>
|
875
875
|
|
876
876
|
<span class='kw'>def</span> <span class='id identifier rubyid_bind_event'>bind_event</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
@@ -878,76 +878,76 @@ data
|
|
878
878
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown event '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
879
879
|
<span class='kw'>end</span>
|
880
880
|
<span class='lparen'>(</span><span class='id identifier rubyid_events'>events</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span>
|
881
|
-
<span class='kw'>end</span></pre>
|
882
|
-
</td>
|
883
|
-
</tr>
|
884
|
-
</table>
|
885
|
-
</div>
|
886
|
-
|
887
|
-
<div class="method_details ">
|
888
|
-
<h3 class="signature " id="find_match-instance_method">
|
889
|
-
|
890
|
-
#<strong>find_match</strong>(filter) ⇒ <tt>Hash</tt><sup>?</sup>
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
</h3><div class="docstring">
|
897
|
-
<div class="discussion">
|
898
|
-
|
899
|
-
<div class="note notetag">
|
900
|
-
<strong>Note:</strong>
|
881
|
+
<span class='kw'>end</span></pre>
|
882
|
+
</td>
|
883
|
+
</tr>
|
884
|
+
</table>
|
885
|
+
</div>
|
886
|
+
|
887
|
+
<div class="method_details ">
|
888
|
+
<h3 class="signature " id="find_match-instance_method">
|
889
|
+
|
890
|
+
#<strong>find_match</strong>(filter) ⇒ <tt>Hash</tt><sup>?</sup>
|
891
|
+
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
</h3><div class="docstring">
|
897
|
+
<div class="discussion">
|
898
|
+
|
899
|
+
<div class="note notetag">
|
900
|
+
<strong>Note:</strong>
|
901
901
|
<div class='inline'>
|
902
902
|
<p><em>Warning:</em> It uses table scan to filter and will be slow.</p>
|
903
|
-
</div>
|
904
|
-
</div>
|
905
|
-
|
903
|
+
</div>
|
904
|
+
</div>
|
905
|
+
|
906
906
|
|
907
907
|
<p>Find an item by matching filter keys</p>
|
908
|
-
|
909
|
-
|
910
|
-
</div>
|
911
|
-
</div>
|
912
|
-
<div class="tags">
|
913
|
-
<p class="tag_title">Parameters:</p>
|
914
|
-
<ul class="param">
|
915
|
-
|
916
|
-
<li>
|
917
|
-
|
918
|
-
<span class='name'>filter</span>
|
919
|
-
|
920
|
-
|
921
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
</li>
|
926
|
-
|
927
|
-
</ul>
|
928
|
-
|
929
|
-
<p class="tag_title">Returns:</p>
|
930
|
-
<ul class="return">
|
931
|
-
|
932
|
-
<li>
|
933
|
-
|
934
|
-
|
935
|
-
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
—
|
908
|
+
|
909
|
+
|
910
|
+
</div>
|
911
|
+
</div>
|
912
|
+
<div class="tags">
|
913
|
+
<p class="tag_title">Parameters:</p>
|
914
|
+
<ul class="param">
|
915
|
+
|
916
|
+
<li>
|
917
|
+
|
918
|
+
<span class='name'>filter</span>
|
919
|
+
|
920
|
+
|
921
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
922
|
+
|
923
|
+
|
924
|
+
|
925
|
+
</li>
|
926
|
+
|
927
|
+
</ul>
|
928
|
+
|
929
|
+
<p class="tag_title">Returns:</p>
|
930
|
+
<ul class="return">
|
931
|
+
|
932
|
+
<li>
|
933
|
+
|
934
|
+
|
935
|
+
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
936
|
+
|
937
|
+
|
938
|
+
|
939
|
+
—
|
940
940
|
<div class='inline'>
|
941
941
|
<p>First existing item match or nil when no match.</p>
|
942
|
-
</div>
|
943
|
-
|
944
|
-
</li>
|
945
|
-
|
946
|
-
</ul>
|
947
|
-
|
948
|
-
</div><table class="source_code">
|
949
|
-
<tr>
|
950
|
-
<td>
|
942
|
+
</div>
|
943
|
+
|
944
|
+
</li>
|
945
|
+
|
946
|
+
</ul>
|
947
|
+
|
948
|
+
</div><table class="source_code">
|
949
|
+
<tr>
|
950
|
+
<td>
|
951
951
|
<pre class="lines">
|
952
952
|
|
953
953
|
|
@@ -955,93 +955,93 @@ data
|
|
955
955
|
218
|
956
956
|
219
|
957
957
|
220
|
958
|
-
221</pre>
|
959
|
-
</td>
|
960
|
-
<td>
|
958
|
+
221</pre>
|
959
|
+
</td>
|
960
|
+
<td>
|
961
961
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 217</span>
|
962
962
|
|
963
963
|
<span class='kw'>def</span> <span class='id identifier rubyid_find_match'>find_match</span> <span class='id identifier rubyid_filter'>filter</span>
|
964
964
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
|
965
965
|
<span class='id identifier rubyid_match_keys?'>match_keys?</span> <span class='id identifier rubyid_item'>item</span><span class='comma'>,</span> <span class='id identifier rubyid_filter'>filter</span>
|
966
966
|
<span class='kw'>end</span>
|
967
|
-
<span class='kw'>end</span></pre>
|
968
|
-
</td>
|
969
|
-
</tr>
|
970
|
-
</table>
|
971
|
-
</div>
|
972
|
-
|
973
|
-
<div class="method_details ">
|
974
|
-
<h3 class="signature " id="match_keys?-instance_method">
|
975
|
-
|
976
|
-
#<strong>match_keys?</strong>(item_a, item_b) ⇒ <tt>Boolean</tt>
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
</h3><div class="docstring">
|
983
|
-
<div class="discussion">
|
967
|
+
<span class='kw'>end</span></pre>
|
968
|
+
</td>
|
969
|
+
</tr>
|
970
|
+
</table>
|
971
|
+
</div>
|
972
|
+
|
973
|
+
<div class="method_details ">
|
974
|
+
<h3 class="signature " id="match_keys?-instance_method">
|
975
|
+
|
976
|
+
#<strong>match_keys?</strong>(item_a, item_b) ⇒ <tt>Boolean</tt>
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
</h3><div class="docstring">
|
983
|
+
<div class="discussion">
|
984
984
|
|
985
985
|
<p>Check whenever two items keys match.</p>
|
986
|
-
|
987
|
-
|
988
|
-
</div>
|
989
|
-
</div>
|
990
|
-
<div class="tags">
|
991
|
-
<p class="tag_title">Parameters:</p>
|
992
|
-
<ul class="param">
|
993
|
-
|
994
|
-
<li>
|
995
|
-
|
996
|
-
<span class='name'>item_a</span>
|
997
|
-
|
998
|
-
|
999
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
—
|
986
|
+
|
987
|
+
|
988
|
+
</div>
|
989
|
+
</div>
|
990
|
+
<div class="tags">
|
991
|
+
<p class="tag_title">Parameters:</p>
|
992
|
+
<ul class="param">
|
993
|
+
|
994
|
+
<li>
|
995
|
+
|
996
|
+
<span class='name'>item_a</span>
|
997
|
+
|
998
|
+
|
999
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1000
|
+
|
1001
|
+
|
1002
|
+
|
1003
|
+
—
|
1004
1004
|
<div class='inline'>
|
1005
1005
|
<p>Item to match.</p>
|
1006
|
-
</div>
|
1007
|
-
|
1008
|
-
</li>
|
1009
|
-
|
1010
|
-
<li>
|
1011
|
-
|
1012
|
-
<span class='name'>item_b</span>
|
1013
|
-
|
1014
|
-
|
1015
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
—
|
1006
|
+
</div>
|
1007
|
+
|
1008
|
+
</li>
|
1009
|
+
|
1010
|
+
<li>
|
1011
|
+
|
1012
|
+
<span class='name'>item_b</span>
|
1013
|
+
|
1014
|
+
|
1015
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1016
|
+
|
1017
|
+
|
1018
|
+
|
1019
|
+
—
|
1020
1020
|
<div class='inline'>
|
1021
1021
|
<p>Item to match.</p>
|
1022
|
-
</div>
|
1023
|
-
|
1024
|
-
</li>
|
1025
|
-
|
1026
|
-
</ul>
|
1027
|
-
|
1028
|
-
<p class="tag_title">Returns:</p>
|
1029
|
-
<ul class="return">
|
1030
|
-
|
1031
|
-
<li>
|
1032
|
-
|
1033
|
-
|
1034
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
</li>
|
1039
|
-
|
1040
|
-
</ul>
|
1041
|
-
|
1042
|
-
</div><table class="source_code">
|
1043
|
-
<tr>
|
1044
|
-
<td>
|
1022
|
+
</div>
|
1023
|
+
|
1024
|
+
</li>
|
1025
|
+
|
1026
|
+
</ul>
|
1027
|
+
|
1028
|
+
<p class="tag_title">Returns:</p>
|
1029
|
+
<ul class="return">
|
1030
|
+
|
1031
|
+
<li>
|
1032
|
+
|
1033
|
+
|
1034
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1035
|
+
|
1036
|
+
|
1037
|
+
|
1038
|
+
</li>
|
1039
|
+
|
1040
|
+
</ul>
|
1041
|
+
|
1042
|
+
</div><table class="source_code">
|
1043
|
+
<tr>
|
1044
|
+
<td>
|
1045
1045
|
<pre class="lines">
|
1046
1046
|
|
1047
1047
|
|
@@ -1053,9 +1053,9 @@ data
|
|
1053
1053
|
192
|
1054
1054
|
193
|
1055
1055
|
194
|
1056
|
-
195</pre>
|
1057
|
-
</td>
|
1058
|
-
<td>
|
1056
|
+
195</pre>
|
1057
|
+
</td>
|
1058
|
+
<td>
|
1059
1059
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/core/smart_collection.rb', line 187</span>
|
1060
1060
|
|
1061
1061
|
<span class='kw'>def</span> <span class='id identifier rubyid_match_keys?'>match_keys?</span> <span class='id identifier rubyid_item_a'>item_a</span><span class='comma'>,</span> <span class='id identifier rubyid_item_b'>item_b</span>
|
@@ -1066,22 +1066,22 @@ data
|
|
1066
1066
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_item_a'>item_a</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='id identifier rubyid_item_b'>item_b</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
1067
1067
|
<span class='kw'>end</span>
|
1068
1068
|
<span class='kw'>true</span>
|
1069
|
-
<span class='kw'>end</span></pre>
|
1070
|
-
</td>
|
1071
|
-
</tr>
|
1072
|
-
</table>
|
1073
|
-
</div>
|
1074
|
-
|
1075
|
-
</div>
|
1076
|
-
|
1077
|
-
</div>
|
1078
|
-
|
1079
|
-
<div id="footer">
|
1080
|
-
Generated on
|
1081
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1082
|
-
0.9.
|
1083
|
-
</div>
|
1084
|
-
|
1085
|
-
</div>
|
1086
|
-
</body>
|
1069
|
+
<span class='kw'>end</span></pre>
|
1070
|
+
</td>
|
1071
|
+
</tr>
|
1072
|
+
</table>
|
1073
|
+
</div>
|
1074
|
+
|
1075
|
+
</div>
|
1076
|
+
|
1077
|
+
</div>
|
1078
|
+
|
1079
|
+
<div id="footer">
|
1080
|
+
Generated on Fri Sep 27 02:01:31 2019 by
|
1081
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1082
|
+
0.9.20 (ruby-2.5.3).
|
1083
|
+
</div>
|
1084
|
+
|
1085
|
+
</div>
|
1086
|
+
</body>
|
1087
1087
|
</html>
|