isimud 0.7.0 → 1.3.1
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/.gitignore +1 -0
- data/.rspec +1 -2
- data/.ruby-version +1 -1
- data/.yardoc/checksums +10 -10
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +63 -73
- data/LICENSE.txt +19 -0
- data/README.md +51 -3
- data/Rakefile +5 -0
- data/doc/Isimud/BunnyClient.html +882 -179
- data/doc/Isimud/Client.html +236 -18
- data/doc/Isimud/Event.html +211 -95
- data/doc/Isimud/EventListener.html +325 -307
- data/doc/Isimud/EventObserver/ClassMethods.html +14 -14
- data/doc/Isimud/EventObserver.html +418 -36
- data/doc/Isimud/Generators/ConfigGenerator.html +2 -2
- data/doc/Isimud/Generators/InitializerGenerator.html +2 -2
- data/doc/Isimud/Generators.html +2 -2
- data/doc/Isimud/Logging.html +3 -3
- data/doc/Isimud/ModelWatcher/ClassMethods.html +3 -3
- data/doc/Isimud/ModelWatcher.html +2 -2
- data/doc/Isimud/Railtie.html +2 -2
- data/doc/Isimud/TestClient/Queue.html +374 -71
- data/doc/Isimud/TestClient.html +169 -161
- data/doc/Isimud.html +80 -76
- data/doc/_index.html +5 -2
- data/doc/file.LICENSE.html +73 -0
- data/doc/file.README.html +131 -7
- data/doc/file_list.html +3 -0
- data/doc/index.html +131 -7
- data/doc/method_list.html +183 -105
- data/doc/top-level-namespace.html +2 -2
- data/isimud.gemspec +18 -16
- data/lib/isimud/bunny_client.rb +85 -32
- data/lib/isimud/client.rb +23 -7
- data/lib/isimud/event.rb +11 -14
- data/lib/isimud/event_listener.rb +123 -65
- data/lib/isimud/event_observer.rb +70 -10
- data/lib/isimud/model_watcher.rb +1 -1
- data/lib/isimud/test_client.rb +54 -26
- data/lib/isimud/version.rb +1 -1
- data/lib/isimud.rb +1 -1
- data/spec/internal/app/models/company.rb +8 -10
- data/spec/internal/app/models/user.rb +11 -1
- data/spec/internal/db/schema.rb +5 -0
- data/spec/isimud/bunny_client_spec.rb +21 -9
- data/spec/isimud/client_spec.rb +40 -0
- data/spec/isimud/event_listener_spec.rb +50 -22
- data/spec/isimud/event_observer_spec.rb +107 -16
- data/spec/isimud/model_watcher_spec.rb +18 -23
- data/spec/isimud/test_client_spec.rb +43 -8
- data/spec/isimud_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- metadata +19 -35
- checksums.yaml.gz.sig +0 -0
- data/certs/gfeil.pem +0 -21
- data/release +0 -31
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -2
data/doc/Isimud/Event.html
CHANGED
@@ -103,7 +103,23 @@
|
|
103
103
|
</dl>
|
104
104
|
<div class="clear"></div>
|
105
105
|
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>A structured message format useful for processing events. Note that each
|
110
|
+
message has a routing key automatically constructed based on four
|
111
|
+
properties: type.eventful_type.eventful_id.action Any blank or nil
|
112
|
+
properties are omitted from the routing key. For convenience, you may
|
113
|
+
construct an event using an eventful object, which sets the eventful_type
|
114
|
+
and eventful_id</p>
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
<div class="tags">
|
120
|
+
|
106
121
|
|
122
|
+
</div>
|
107
123
|
<h2>Constant Summary</h2>
|
108
124
|
|
109
125
|
<dl class="constants">
|
@@ -146,6 +162,33 @@
|
|
146
162
|
<p>Returns the value of attribute action.</p>
|
147
163
|
</div></span>
|
148
164
|
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong> </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<span class="summary_desc"><div class='inline'>
|
189
|
+
<p>Returns the value of attribute attributes.</p>
|
190
|
+
</div></span>
|
191
|
+
|
149
192
|
</li>
|
150
193
|
|
151
194
|
|
@@ -561,9 +604,9 @@
|
|
561
604
|
<h3 class="signature first" id="initialize-instance_method">
|
562
605
|
|
563
606
|
|
564
|
-
<span class="overload">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>
|
607
|
+
<span class="overload">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>new</strong>(user, eventful, attributes) </span>
|
565
608
|
|
566
|
-
<span class="overload">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>
|
609
|
+
<span class="overload">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>new</strong>(attributes) </span>
|
567
610
|
|
568
611
|
|
569
612
|
|
@@ -573,7 +616,7 @@
|
|
573
616
|
</h3><div class="docstring">
|
574
617
|
<div class="discussion">
|
575
618
|
|
576
|
-
<p>Initialize a new Event
|
619
|
+
<p>Initialize a new Event.</p>
|
577
620
|
|
578
621
|
|
579
622
|
</div>
|
@@ -585,13 +628,13 @@
|
|
585
628
|
|
586
629
|
|
587
630
|
<li class="overload_item">
|
588
|
-
<span class="signature">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>
|
631
|
+
<span class="signature">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>new</strong>(user, eventful, attributes) </span>
|
589
632
|
<div class="docstring">
|
590
633
|
<div class="discussion">
|
591
634
|
|
592
635
|
<p>@<a href="#id">param</a> user user associated by the event @<a
|
593
636
|
href="ActiveRecord::Base">param</a> eventful object associated with event
|
594
|
-
@<a href="Hash">param</a> parameters optional additional
|
637
|
+
@<a href="Hash">param</a> parameters optional additional attributes</p>
|
595
638
|
|
596
639
|
|
597
640
|
</div>
|
@@ -604,7 +647,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
604
647
|
|
605
648
|
|
606
649
|
<li class="overload_item">
|
607
|
-
<span class="signature">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>
|
650
|
+
<span class="signature">- (<tt><span class='object_link'><a href="" title="Isimud::Event (class)">Event</a></span></tt>) <strong>new</strong>(attributes) </span>
|
608
651
|
<div class="docstring">
|
609
652
|
<div class="discussion">
|
610
653
|
|
@@ -642,7 +685,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
642
685
|
</span>
|
643
686
|
|
644
687
|
— <div class='inline'>
|
645
|
-
<p>
|
688
|
+
<p>type of object associated with event</p>
|
646
689
|
</div>
|
647
690
|
|
648
691
|
</li>
|
@@ -678,13 +721,14 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
678
721
|
|
679
722
|
<li>
|
680
723
|
<span class="name">:eventful</span>
|
681
|
-
<span class="type">(<tt
|
724
|
+
<span class="type">(<tt>#id</tt>)</span>
|
682
725
|
<span class="default">
|
683
726
|
|
684
727
|
</span>
|
685
728
|
|
686
729
|
— <div class='inline'>
|
687
|
-
<p>object associated with event. This sets :eventful_type and :eventful_id
|
730
|
+
<p>object associated with event. This sets :eventful_type and :eventful_id
|
731
|
+
based on the class and ID of the object.</p>
|
688
732
|
</div>
|
689
733
|
|
690
734
|
</li>
|
@@ -707,7 +751,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
707
751
|
|
708
752
|
<li>
|
709
753
|
<span class="name">:action</span>
|
710
|
-
<span class="type">(<tt>String</tt>)</span>
|
754
|
+
<span class="type">(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
711
755
|
<span class="default">
|
712
756
|
|
713
757
|
</span>
|
@@ -734,6 +778,19 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
734
778
|
|
735
779
|
</li>
|
736
780
|
|
781
|
+
<li>
|
782
|
+
<span class="name">:attributes</span>
|
783
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
784
|
+
<span class="default">
|
785
|
+
|
786
|
+
</span>
|
787
|
+
|
788
|
+
— <div class='inline'>
|
789
|
+
<p>event attributes</p>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
</li>
|
793
|
+
|
737
794
|
<li>
|
738
795
|
<span class="name">:parameters</span>
|
739
796
|
<span class="type">(<tt>Hash</tt>)</span>
|
@@ -742,7 +799,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
742
799
|
</span>
|
743
800
|
|
744
801
|
— <div class='inline'>
|
745
|
-
<p>additional parameters</p>
|
802
|
+
<p>additional parameters (deprecated)</p>
|
746
803
|
</div>
|
747
804
|
|
748
805
|
</li>
|
@@ -763,13 +820,6 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
763
820
|
<pre class="lines">
|
764
821
|
|
765
822
|
|
766
|
-
27
|
767
|
-
28
|
768
|
-
29
|
769
|
-
30
|
770
|
-
31
|
771
|
-
32
|
772
|
-
33
|
773
823
|
34
|
774
824
|
35
|
775
825
|
36
|
@@ -795,10 +845,17 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
795
845
|
56
|
796
846
|
57
|
797
847
|
58
|
798
|
-
59
|
848
|
+
59
|
849
|
+
60
|
850
|
+
61
|
851
|
+
62
|
852
|
+
63
|
853
|
+
64
|
854
|
+
65
|
855
|
+
66</pre>
|
799
856
|
</td>
|
800
857
|
<td>
|
801
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
858
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 34</span>
|
802
859
|
|
803
860
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
804
861
|
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_extract_options!'>extract_options!</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
|
@@ -830,7 +887,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
830
887
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_eventful_type'>eventful_type</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:eventful_type</span><span class='rparen'>)</span>
|
831
888
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_eventful_id'>eventful_id</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:eventful_id</span><span class='rparen'>)</span>
|
832
889
|
<span class='kw'>end</span>
|
833
|
-
|
890
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:attributes</span><span class='rparen'>)</span>
|
834
891
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parameters'>parameters</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:parameters</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_options'>options</span>
|
835
892
|
<span class='kw'>end</span></pre>
|
836
893
|
</td>
|
@@ -871,12 +928,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
871
928
|
<pre class="lines">
|
872
929
|
|
873
930
|
|
874
|
-
|
875
|
-
|
876
|
-
|
931
|
+
11
|
932
|
+
12
|
933
|
+
13</pre>
|
877
934
|
</td>
|
878
935
|
<td>
|
879
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
936
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
880
937
|
|
881
938
|
<span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span>
|
882
939
|
<span class='ivar'>@action</span>
|
@@ -887,6 +944,49 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
887
944
|
</div>
|
888
945
|
|
889
946
|
|
947
|
+
<span id="attributes=-instance_method"></span>
|
948
|
+
<div class="method_details ">
|
949
|
+
<h3 class="signature " id="attributes-instance_method">
|
950
|
+
|
951
|
+
- (<tt>Object</tt>) <strong>attributes</strong>
|
952
|
+
|
953
|
+
|
954
|
+
|
955
|
+
|
956
|
+
|
957
|
+
</h3><div class="docstring">
|
958
|
+
<div class="discussion">
|
959
|
+
|
960
|
+
<p>Returns the value of attribute attributes</p>
|
961
|
+
|
962
|
+
|
963
|
+
</div>
|
964
|
+
</div>
|
965
|
+
<div class="tags">
|
966
|
+
|
967
|
+
|
968
|
+
</div><table class="source_code">
|
969
|
+
<tr>
|
970
|
+
<td>
|
971
|
+
<pre class="lines">
|
972
|
+
|
973
|
+
|
974
|
+
11
|
975
|
+
12
|
976
|
+
13</pre>
|
977
|
+
</td>
|
978
|
+
<td>
|
979
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
980
|
+
|
981
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
982
|
+
<span class='ivar'>@attributes</span>
|
983
|
+
<span class='kw'>end</span></pre>
|
984
|
+
</td>
|
985
|
+
</tr>
|
986
|
+
</table>
|
987
|
+
</div>
|
988
|
+
|
989
|
+
|
890
990
|
<span id="eventful_id=-instance_method"></span>
|
891
991
|
<div class="method_details ">
|
892
992
|
<h3 class="signature " id="eventful_id-instance_method">
|
@@ -914,12 +1014,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
914
1014
|
<pre class="lines">
|
915
1015
|
|
916
1016
|
|
917
|
-
|
918
|
-
|
919
|
-
|
1017
|
+
11
|
1018
|
+
12
|
1019
|
+
13</pre>
|
920
1020
|
</td>
|
921
1021
|
<td>
|
922
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1022
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
923
1023
|
|
924
1024
|
<span class='kw'>def</span> <span class='id identifier rubyid_eventful_id'>eventful_id</span>
|
925
1025
|
<span class='ivar'>@eventful_id</span>
|
@@ -957,12 +1057,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
957
1057
|
<pre class="lines">
|
958
1058
|
|
959
1059
|
|
960
|
-
|
961
|
-
|
962
|
-
|
1060
|
+
11
|
1061
|
+
12
|
1062
|
+
13</pre>
|
963
1063
|
</td>
|
964
1064
|
<td>
|
965
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1065
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
966
1066
|
|
967
1067
|
<span class='kw'>def</span> <span class='id identifier rubyid_eventful_type'>eventful_type</span>
|
968
1068
|
<span class='ivar'>@eventful_type</span>
|
@@ -989,12 +1089,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
989
1089
|
<pre class="lines">
|
990
1090
|
|
991
1091
|
|
992
|
-
|
993
|
-
|
994
|
-
|
1092
|
+
68
|
1093
|
+
69
|
1094
|
+
70</pre>
|
995
1095
|
</td>
|
996
1096
|
<td>
|
997
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1097
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 68</span>
|
998
1098
|
|
999
1099
|
<span class='kw'>def</span> <span class='id identifier rubyid_exchange'>exchange</span>
|
1000
1100
|
<span class='ivar'>@exchange</span> <span class='op'>||</span> <span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_events_exchange'>events_exchange</span>
|
@@ -1032,12 +1132,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1032
1132
|
<pre class="lines">
|
1033
1133
|
|
1034
1134
|
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1135
|
+
11
|
1136
|
+
12
|
1137
|
+
13</pre>
|
1038
1138
|
</td>
|
1039
1139
|
<td>
|
1040
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1140
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
1041
1141
|
|
1042
1142
|
<span class='kw'>def</span> <span class='id identifier rubyid_occurred_at'>occurred_at</span>
|
1043
1143
|
<span class='ivar'>@occurred_at</span>
|
@@ -1075,12 +1175,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1075
1175
|
<pre class="lines">
|
1076
1176
|
|
1077
1177
|
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1178
|
+
11
|
1179
|
+
12
|
1180
|
+
13</pre>
|
1081
1181
|
</td>
|
1082
1182
|
<td>
|
1083
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1183
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
1084
1184
|
|
1085
1185
|
<span class='kw'>def</span> <span class='id identifier rubyid_parameters'>parameters</span>
|
1086
1186
|
<span class='ivar'>@parameters</span>
|
@@ -1118,12 +1218,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1118
1218
|
<pre class="lines">
|
1119
1219
|
|
1120
1220
|
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1221
|
+
11
|
1222
|
+
12
|
1223
|
+
13</pre>
|
1124
1224
|
</td>
|
1125
1225
|
<td>
|
1126
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1226
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
1127
1227
|
|
1128
1228
|
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
1129
1229
|
<span class='ivar'>@type</span>
|
@@ -1161,12 +1261,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1161
1261
|
<pre class="lines">
|
1162
1262
|
|
1163
1263
|
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1264
|
+
11
|
1265
|
+
12
|
1266
|
+
13</pre>
|
1167
1267
|
</td>
|
1168
1268
|
<td>
|
1169
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1269
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 11</span>
|
1170
1270
|
|
1171
1271
|
<span class='kw'>def</span> <span class='id identifier rubyid_user_id'>user_id</span>
|
1172
1272
|
<span class='ivar'>@user_id</span>
|
@@ -1198,12 +1298,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1198
1298
|
<pre class="lines">
|
1199
1299
|
|
1200
1300
|
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1301
|
+
109
|
1302
|
+
110
|
1303
|
+
111</pre>
|
1204
1304
|
</td>
|
1205
1305
|
<td>
|
1206
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1306
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 109</span>
|
1207
1307
|
|
1208
1308
|
<span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1209
1309
|
<span class='const'>Event</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span>
|
@@ -1228,12 +1328,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1228
1328
|
<pre class="lines">
|
1229
1329
|
|
1230
1330
|
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1331
|
+
101
|
1332
|
+
102
|
1333
|
+
103</pre>
|
1234
1334
|
</td>
|
1235
1335
|
<td>
|
1236
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1336
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 101</span>
|
1237
1337
|
|
1238
1338
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
1239
1339
|
<span class='const'>Event</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -1258,12 +1358,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1258
1358
|
<pre class="lines">
|
1259
1359
|
|
1260
1360
|
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1361
|
+
105
|
1362
|
+
106
|
1363
|
+
107</pre>
|
1264
1364
|
</td>
|
1265
1365
|
<td>
|
1266
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1366
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 105</span>
|
1267
1367
|
|
1268
1368
|
<span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1269
1369
|
<span class='const'>Event</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span>
|
@@ -1334,7 +1434,7 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1334
1434
|
</span>
|
1335
1435
|
|
1336
1436
|
— <div class='inline'>
|
1337
|
-
<p>when set, do not include parameters in data</p>
|
1437
|
+
<p>when set, do not include attributes or parameters in data</p>
|
1338
1438
|
</div>
|
1339
1439
|
|
1340
1440
|
</li>
|
@@ -1367,24 +1467,40 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1367
1467
|
<pre class="lines">
|
1368
1468
|
|
1369
1469
|
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1470
|
+
79
|
1471
|
+
80
|
1472
|
+
81
|
1473
|
+
82
|
1474
|
+
83
|
1475
|
+
84
|
1476
|
+
85
|
1477
|
+
86
|
1478
|
+
87
|
1479
|
+
88
|
1480
|
+
89
|
1481
|
+
90
|
1482
|
+
91
|
1483
|
+
92
|
1484
|
+
93
|
1485
|
+
94</pre>
|
1378
1486
|
</td>
|
1379
1487
|
<td>
|
1380
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1488
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 79</span>
|
1381
1489
|
|
1382
1490
|
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1383
1491
|
<span class='id identifier rubyid_session_id'>session_id</span> <span class='op'>=</span> <span class='id identifier rubyid_parameters'>parameters</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:session_id</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='symbol'>:keas_session_id</span><span class='rbracket'>]</span>
|
1384
1492
|
|
1385
|
-
<span class='id identifier rubyid_data'>data</span>
|
1386
|
-
|
1387
|
-
|
1493
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>type:</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span>
|
1494
|
+
<span class='label'>action:</span> <span class='id identifier rubyid_action'>action</span><span class='comma'>,</span>
|
1495
|
+
<span class='label'>user_id:</span> <span class='id identifier rubyid_user_id'>user_id</span><span class='comma'>,</span>
|
1496
|
+
<span class='label'>occurred_at:</span> <span class='id identifier rubyid_occurred_at'>occurred_at</span><span class='comma'>,</span>
|
1497
|
+
<span class='label'>eventful_type:</span> <span class='id identifier rubyid_eventful_type'>eventful_type</span><span class='comma'>,</span>
|
1498
|
+
<span class='label'>eventful_id:</span> <span class='id identifier rubyid_eventful_id'>eventful_id</span><span class='comma'>,</span>
|
1499
|
+
<span class='label'>session_id:</span> <span class='id identifier rubyid_session_id'>session_id</span><span class='rbrace'>}</span>
|
1500
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:omit_parameters</span><span class='rbracket'>]</span>
|
1501
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:parameters</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parameters'>parameters</span>
|
1502
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:attributes</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
1503
|
+
<span class='kw'>end</span>
|
1388
1504
|
<span class='id identifier rubyid_data'>data</span>
|
1389
1505
|
<span class='kw'>end</span></pre>
|
1390
1506
|
</td>
|
@@ -1407,18 +1523,18 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1407
1523
|
<pre class="lines">
|
1408
1524
|
|
1409
1525
|
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1526
|
+
112
|
1527
|
+
113
|
1528
|
+
114
|
1529
|
+
115
|
1530
|
+
116</pre>
|
1415
1531
|
</td>
|
1416
1532
|
<td>
|
1417
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1533
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 112</span>
|
1418
1534
|
|
1419
1535
|
<span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span>
|
1420
1536
|
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_serialize'>serialize</span>
|
1421
|
-
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Event#publish: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span
|
1537
|
+
<span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Event#publish: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1422
1538
|
<span class='const'>Isimud</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_routing_key'>routing_key</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
1423
1539
|
<span class='kw'>end</span></pre>
|
1424
1540
|
</td>
|
@@ -1441,12 +1557,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1441
1557
|
<pre class="lines">
|
1442
1558
|
|
1443
1559
|
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1560
|
+
72
|
1561
|
+
73
|
1562
|
+
74</pre>
|
1447
1563
|
</td>
|
1448
1564
|
<td>
|
1449
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1565
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 72</span>
|
1450
1566
|
|
1451
1567
|
<span class='kw'>def</span> <span class='id identifier rubyid_routing_key'>routing_key</span>
|
1452
1568
|
<span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_eventful_type'>eventful_type</span><span class='comma'>,</span> <span class='id identifier rubyid_eventful_id'>eventful_id</span><span class='comma'>,</span> <span class='id identifier rubyid_action'>action</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
@@ -1471,12 +1587,12 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1471
1587
|
<pre class="lines">
|
1472
1588
|
|
1473
1589
|
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1590
|
+
96
|
1591
|
+
97
|
1592
|
+
98</pre>
|
1477
1593
|
</td>
|
1478
1594
|
<td>
|
1479
|
-
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line
|
1595
|
+
<pre class="code"><span class="info file"># File 'lib/isimud/event.rb', line 96</span>
|
1480
1596
|
|
1481
1597
|
<span class='kw'>def</span> <span class='id identifier rubyid_serialize'>serialize</span>
|
1482
1598
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
@@ -1491,9 +1607,9 @@ href="ActiveRecord::Base">param</a> eventful object associated with event
|
|
1491
1607
|
</div>
|
1492
1608
|
|
1493
1609
|
<div id="footer">
|
1494
|
-
Generated on
|
1610
|
+
Generated on Wed Jan 13 16:27:29 2016 by
|
1495
1611
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1496
|
-
0.8.7.6 (ruby-2.2.
|
1612
|
+
0.8.7.6 (ruby-2.2.3).
|
1497
1613
|
</div>
|
1498
1614
|
|
1499
1615
|
</body>
|