From d22577c0f93951bf03f4464e2ddbda7d41993b45 Mon Sep 17 00:00:00 2001 From: Nicholas Audo Date: Tue, 6 Mar 2012 22:01:58 -0800 Subject: [PATCH] some more docs --- .yardoc/checksums | 10 +- .yardoc/objects/root.dat | Bin 33407 -> 32747 bytes doc/Riaction.html | 6 +- doc/Riaction/ConfigurationError.html | 2 +- doc/Riaction/Constants.html | 107 ++++++++++++++---- doc/Riaction/CrudEventCallback.html | 83 ++++++++++---- doc/Riaction/EventPerformer.html | 33 ++++-- doc/Riaction/NoEventDefined.html | 2 +- doc/Riaction/NoProfileDefined.html | 2 +- doc/Riaction/ProfileCreationCallback.html | 27 +++-- doc/Riaction/ProfileCreator.html | 2 +- doc/Riaction/Railtie.html | 2 +- doc/Riaction/Riaction.html | 2 +- doc/Riaction/Riaction/ClassMethods.html | 77 ++++++++----- doc/Riaction/Riaction/Event.html | 2 +- .../Riaction/Event/InstanceMethods.html | 22 ++-- doc/Riaction/Riaction/InstanceMethods.html | 12 +- doc/Riaction/Riaction/Profile.html | 2 +- .../Riaction/Profile/InstanceMethods.html | 102 ++++++++--------- doc/Riaction/RuntimeError.html | 2 +- doc/RiactionGenerator.html | 2 +- doc/_index.html | 21 ++-- doc/class_list.html | 2 +- doc/file.README.html | 2 +- doc/index.html | 2 +- doc/method_list.html | 48 ++++---- doc/top-level-namespace.html | 2 +- lib/riaction/constants.rb | 8 +- lib/riaction/crud_event_callback.rb | 3 + lib/riaction/event_performer.rb | 2 +- lib/riaction/profile_creation_callback.rb | 2 + lib/riaction/riaction.rb | 3 + riaction.gemspec | 4 +- 33 files changed, 374 insertions(+), 224 deletions(-) diff --git a/.yardoc/checksums b/.yardoc/checksums index 1a0c76f..29d9fa1 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,11 +1,11 @@ lib/riaction.rb dd83c27c1316ce70e4d5bb9aa2d126f6cfc9d861 lib/riaction/railtie.rb 13e4d474afcbaa065c9f287a3d162b14c9879827 lib/riaction/version.rb 264747da6cacfd2f8186c6c2ab4f1a668c9e0f63 -lib/riaction/riaction.rb db9cebd4ec6f2b4559a50490cbe7a7bdc8e5e617 -lib/riaction/constants.rb 458b6b0dc98bf9ee3b2e2e56ed8c1b65e6818fa0 +lib/riaction/riaction.rb 959359e794a937f9272add18734171304000553b +lib/riaction/constants.rb 3770b204697e3bf3f649d797ce2100c7bd9ad252 lib/rspec/matchers/riaction.rb cfee977b937126ec92bebf643001671779428d19 -lib/riaction/event_performer.rb 167554caa6e993ab6c669ee8c9799da3fae4c860 +lib/riaction/event_performer.rb e4f5cf51475317713a0dfa92f159ee5b69b979b8 lib/riaction/profile_creator.rb 29f4cf5ebadf3d22158fb2ad2d36a69bda5b68e3 -lib/riaction/crud_event_callback.rb 85af7b455a412a27a428003afd6acde3503439ce -lib/riaction/profile_creation_callback.rb 3c56bfce338de416aef0c0328aa1f8892885ccef +lib/riaction/crud_event_callback.rb d03b7cfed24abc9c45cc0f3a06373ded9a9f767a +lib/riaction/profile_creation_callback.rb 3ca1be07c164b1d4597c285535706cf0a2681fee lib/generators/riaction/riaction_generator.rb deb5895bd9ecdaa15c49dc81b6172e2333b89b0b diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat index 8ccc65e38f5e27198c32d3ded7d4405223fdfd80..161e74ab082eb09dccbeea3d969f3083e2970133 100644 GIT binary patch delta 3970 zcmcIneQZhce&{!g=N12*nY7`Bb>8d=KP_?M6AIXea&0@NCSRGQMBP_0sDQrj? zmXnbLL!iM!2o)V-aw4It1IdIEcS5(zGbsH37lJ=E)h_pmb|pHb`lLF)^fkX!A0pq8 zf&z88AXT{nUUs>g3mAT?nXYh}$X8D)OdX!%KPt!P7_&GIilxuFI$Y#5+$wJ;Z@`%~ zEZtY}Gh%;3a(7B)VjalkZg{n-5aa?6IdAx%sQQqQAHxoBBe?|M^bV6tr>e`~bMK4f zB0MAb!&fB1FI9I+HT^kKMZZmxb`(fEyM)3_Og4#iO5I&Tj`63=FYW5LbqS7kO^YaU z)O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z8h^g?=WHgcy)yzIrGh39n!x4}% zt7XjRWAsolo6wnXF}5hZaKs39!qwK8NNv`O%20S0Z$H`27S+6i@jsag6vskRb!OAa z~#dsfUX~#$aX4L|rfL9!g!E+vY>0i8T)dekS)CrO(WoqPpg@9A`ag%k}Kz{k>~ z9O-HECQ=*bfEwmrv}D>D5&ooGif77n^b&N;SkYoG!jFrrc+XLg7lb$X4d|ctm?Ei} zt{`0HG2#m7g7k1}o!+Rs$u}zZ#wAa&L4Hf|T{#ke(r3mi)5Ur{@Em?NU9Af;2Yx*5 z2N!ZPeR?Jz~4xX*a0BaiTpp?`Krcam(L?d&1?9MK)fcUO}A1&u%as;q!mmw~U%-g`rJ`y8aPjqw3o zsPNKqkntW;uA^m$@$2xBLshh#V!T^kT5@+qkS-IF&d06BL@G$fkjI5#8R|Tv`i0k4 z({hpV%{UjW!E?t7b#If#v8ab)xS_0Eh3XLrvJV;WB{e68V@9gNm*}6X*H!9xd@bHe ZFJ7BYmDefined in:
lib/riaction/railtie.rb,
- lib/riaction/version.rb,
lib/riaction/riaction.rb,
lib/riaction/constants.rb,
lib/riaction/event_performer.rb,
lib/riaction/profile_creator.rb,
lib/riaction/crud_event_callback.rb,
lib/riaction/profile_creation_callback.rb
+ lib/riaction/version.rb,
lib/riaction/riaction.rb,
lib/riaction/constants.rb,
lib/riaction/profile_creator.rb,
lib/riaction/crud_event_callback.rb,
lib/riaction/profile_creation_callback.rb
@@ -87,7 +87,7 @@

Defined Under Namespace

- Classes: ConfigurationError, Constants, CrudEventCallback, EventPerformer, NoEventDefined, NoProfileDefined, ProfileCreationCallback, ProfileCreator, Railtie, RuntimeError + Classes: ConfigurationError, Constants, CrudEventCallback, NoEventDefined, NoProfileDefined, ProfileCreationCallback, ProfileCreator, Railtie, RuntimeError

@@ -115,7 +115,7 @@

Constant Summary

diff --git a/doc/Riaction/ConfigurationError.html b/doc/Riaction/ConfigurationError.html index 6416859..8141872 100644 --- a/doc/Riaction/ConfigurationError.html +++ b/doc/Riaction/ConfigurationError.html @@ -107,7 +107,7 @@ diff --git a/doc/Riaction/Constants.html b/doc/Riaction/Constants.html index 30114c7..830a16e 100644 --- a/doc/Riaction/Constants.html +++ b/doc/Riaction/Constants.html @@ -123,7 +123,9 @@

-
+
+

sets the default actions to be considered as part of riaction.

+
@@ -144,7 +146,10 @@

-
+
+

sets the default number of attempts to retry a action incase of an internal +error.

+
@@ -186,7 +191,9 @@

-
+
+

sets the valid supported identifiers.

+
@@ -207,18 +214,29 @@

Class Method Details

-

+

+
+ +

sets the default actions to be considered as part of riaction

+ + +
+
+
+ + +
 
 
-3
 4
-5
+5 +6
-
# File 'lib/riaction/constants.rb', line 3
+      
# File 'lib/riaction/constants.rb', line 4
 
 def self.crud_actions
   Set.new [:create, :update, :destroy]
@@ -235,18 +253,30 @@ 

Class Method Details

-

+

+
+ +

sets the default number of attempts to retry a action incase of an internal +error

+ + +
+
+
+ + +
 
 
-7
-8
-9
+9 +10 +11
-
# File 'lib/riaction/constants.rb', line 7
+      
# File 'lib/riaction/constants.rb', line 9
 
 def self.retry_attempts_for_internal_error
   3
@@ -269,14 +299,14 @@ 

Class Method Details

 
 
-15
-16
-17
-18
-19
+19 +20 +21 +22 +23
-
# File 'lib/riaction/constants.rb', line 15
+      
# File 'lib/riaction/constants.rb', line 19
 
 def self.riaction_options
   {
@@ -295,18 +325,47 @@ 

Class Method Details

-

+

+
+ +

sets the valid supported identifiers

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    returns an array of symbols

    +
    + +
  • + +
+ +
 
 
-11
-12
-13
+15 +16 +17
-
# File 'lib/riaction/constants.rb', line 11
+      
# File 'lib/riaction/constants.rb', line 15
 
 def self.supported_identifier_types
   [:email,:username,:custom,:facebook,:twitter,:salesforce]
@@ -321,7 +380,7 @@ 

Class Method Details

diff --git a/doc/Riaction/CrudEventCallback.html b/doc/Riaction/CrudEventCallback.html index 24c1a7c..3913791 100644 --- a/doc/Riaction/CrudEventCallback.html +++ b/doc/Riaction/CrudEventCallback.html @@ -123,7 +123,10 @@

-
+
+

Enqueues a Riaction::EventPerformer object in resque after a model has been +created.

+
@@ -144,7 +147,10 @@

-
+
+

Enqueues a Riaction::EventPerformer object in resque after a model has been +destroyed.

+
@@ -165,7 +171,10 @@

-
+
+

Enqueues a Riaction::EventPerformer object in resque after a model has been +updated.

+
@@ -254,20 +263,32 @@

Instance Method Details

-

+

+
+ +

Enqueues a Riaction::EventPerformer object in resque after a model has been +created

+ + +
+
+
+ + +
 
 
-10
 11
 12
 13
-14
+14 +15
-
# File 'lib/riaction/crud_event_callback.rb', line 10
+      
# File 'lib/riaction/crud_event_callback.rb', line 11
 
 def after_create(record)
   if record.riaction_log_event?(@event_name) && !record.class.riactionless?
@@ -286,20 +307,32 @@ 

Instance Method Details

-

+

+
+ +

Enqueues a Riaction::EventPerformer object in resque after a model has been +destroyed

+ + +
+
+
+ + +
 
 
-22
-23
-24
 25
-26
+26 +27 +28 +29
-
# File 'lib/riaction/crud_event_callback.rb', line 22
+      
# File 'lib/riaction/crud_event_callback.rb', line 25
 
 def after_destroy(record)
   if record.riaction_log_event?(@event_name) && !record.class.riactionless?
@@ -318,20 +351,32 @@ 

Instance Method Details

-

+

+
+ +

Enqueues a Riaction::EventPerformer object in resque after a model has been +updated

+ + +
+
+
+ + +
 
 
-16
-17
 18
 19
-20
+20 +21 +22
-
# File 'lib/riaction/crud_event_callback.rb', line 16
+      
# File 'lib/riaction/crud_event_callback.rb', line 18
 
 def after_update(record)            
   if record.riaction_log_event?(@event_name) && !record.class.riactionless?
@@ -348,7 +393,7 @@ 

Instance Method Details

diff --git a/doc/Riaction/EventPerformer.html b/doc/Riaction/EventPerformer.html index fd60999..534ec95 100644 --- a/doc/Riaction/EventPerformer.html +++ b/doc/Riaction/EventPerformer.html @@ -123,7 +123,10 @@

-
+
+

Sends an event to IActionable based on the name of a riaction class and the +ID used to locate the instance.

+
@@ -144,15 +147,26 @@

Class Method Details

-

+

+
+ +

Sends an event to IActionable based on the name of a riaction class and the +ID used to locate the instance

+ +

@param event_name something

+ + +
+
+
+ + +
 
 
-8
-9
-10
 11
 12
 13
@@ -179,10 +193,13 @@ 

Class Method Details

34 35 36 -37
+37 +38 +39 +40
-
# File 'lib/riaction/event_performer.rb', line 8
+      
# File 'lib/riaction/event_performer.rb', line 11
 
 def self.perform(event_name, klass_name, id, attempt=0)
   event_name_sym = event_name.to_sym
@@ -224,7 +241,7 @@ 

Class Method Details

diff --git a/doc/Riaction/NoEventDefined.html b/doc/Riaction/NoEventDefined.html index 01447af..553533e 100644 --- a/doc/Riaction/NoEventDefined.html +++ b/doc/Riaction/NoEventDefined.html @@ -107,7 +107,7 @@ diff --git a/doc/Riaction/NoProfileDefined.html b/doc/Riaction/NoProfileDefined.html index 5fd1f30..0f41ca0 100644 --- a/doc/Riaction/NoProfileDefined.html +++ b/doc/Riaction/NoProfileDefined.html @@ -107,7 +107,7 @@ diff --git a/doc/Riaction/ProfileCreationCallback.html b/doc/Riaction/ProfileCreationCallback.html index 732b4b2..a20e990 100644 --- a/doc/Riaction/ProfileCreationCallback.html +++ b/doc/Riaction/ProfileCreationCallback.html @@ -123,7 +123,9 @@

-
+
+

Enqueue a Riaction::ProfileCreatore object in resque.

+
@@ -144,18 +146,29 @@

Instance Method Details

-

+

+
+ +

Enqueue a Riaction::ProfileCreatore object in resque

+ + +
+
+
+ + +
 
 
-6
-7
-8
+8 +9 +10
-
# File 'lib/riaction/profile_creation_callback.rb', line 6
+      
# File 'lib/riaction/profile_creation_callback.rb', line 8
 
 def after_create(record)
   Resque.enqueue(::Riaction::ProfileCreator, record.class.base_class.to_s, record.id) unless record.class.riactionless?
@@ -170,7 +183,7 @@ 

Instance Method Details

diff --git a/doc/Riaction/ProfileCreator.html b/doc/Riaction/ProfileCreator.html index 5188ced..a57e3ca 100644 --- a/doc/Riaction/ProfileCreator.html +++ b/doc/Riaction/ProfileCreator.html @@ -226,7 +226,7 @@

Class Method Details

diff --git a/doc/Riaction/Railtie.html b/doc/Riaction/Railtie.html index cf5d4e5..8f925b9 100644 --- a/doc/Riaction/Railtie.html +++ b/doc/Riaction/Railtie.html @@ -107,7 +107,7 @@ diff --git a/doc/Riaction/Riaction.html b/doc/Riaction/Riaction.html index 568bf57..d3a21f2 100644 --- a/doc/Riaction/Riaction.html +++ b/doc/Riaction/Riaction.html @@ -116,7 +116,7 @@

Constant Summary

diff --git a/doc/Riaction/Riaction/ClassMethods.html b/doc/Riaction/Riaction/ClassMethods.html index 6305d0b..515011a 100644 --- a/doc/Riaction/Riaction/ClassMethods.html +++ b/doc/Riaction/Riaction/ClassMethods.html @@ -108,7 +108,10 @@

-
+
+

Patches a class to turn it into a riactionary class, providing some default +checks and attributes.

+
@@ -255,13 +258,24 @@

Instance Method Details

-

+

+
+ +

Patches a class to turn it into a riactionary class, providing some default +checks and attributes

+ + +
+
+
+ + +
 
 
-41
 42
 43
 44
@@ -370,14 +384,19 @@ 

Instance Method Details

147 148 149 -150
+150 +151 +152 +153
-
# File 'lib/riaction/riaction.rb', line 41
+      
# File 'lib/riaction/riaction.rb', line 42
 
 def establish_riactionary_class
   class << self
-    def riactionary?
+
+    # returns true if a class has riaction setup
+    def riactionary?
       true
     end
     
@@ -503,9 +522,6 @@ 

Instance Method Details

 
 
-166
-167
-168
 169
 170
 171
@@ -517,10 +533,13 @@ 

Instance Method Details

177 178 179 -180
+180 +181 +182 +183
-
# File 'lib/riaction/riaction.rb', line 166
+      
# File 'lib/riaction/riaction.rb', line 169
 
 def establish_riactionary_event_class
   (::Riaction::Riaction::EVENT_CLASSES << self.to_s).uniq!
@@ -555,9 +574,6 @@ 

Instance Method Details

 
 
-152
-153
-154
 155
 156
 157
@@ -567,10 +583,13 @@ 

Instance Method Details

161 162 163 -164
+164 +165 +166 +167
-
# File 'lib/riaction/riaction.rb', line 152
+      
# File 'lib/riaction/riaction.rb', line 155
 
 def establish_riactionary_profile_class
   (::Riaction::Riaction::PROFILE_CLASSES << self.to_s).uniq!
@@ -689,12 +708,12 @@ 

Returns:

 
 
-190
-191
-192
+193 +194 +195
-
# File 'lib/riaction/riaction.rb', line 190
+      
# File 'lib/riaction/riaction.rb', line 193
 
 def riaction_events?
   false
@@ -739,12 +758,12 @@ 

Returns:

 
 
-186
-187
-188
+189 +190 +191
-
# File 'lib/riaction/riaction.rb', line 186
+      
# File 'lib/riaction/riaction.rb', line 189
 
 def riaction_profile?
   false
@@ -789,12 +808,12 @@ 

Returns:

 
 
-182
-183
-184
+185 +186 +187
-
# File 'lib/riaction/riaction.rb', line 182
+      
# File 'lib/riaction/riaction.rb', line 185
 
 def riactionary?
   false
@@ -809,7 +828,7 @@ 

Returns:

diff --git a/doc/Riaction/Riaction/Event.html b/doc/Riaction/Riaction/Event.html index 4408784..8652dab 100644 --- a/doc/Riaction/Riaction/Event.html +++ b/doc/Riaction/Riaction/Event.html @@ -99,7 +99,7 @@

Defined Under Namespace

diff --git a/doc/Riaction/Riaction/Event/InstanceMethods.html b/doc/Riaction/Riaction/Event/InstanceMethods.html index 3b0cb54..a633ee8 100644 --- a/doc/Riaction/Riaction/Event/InstanceMethods.html +++ b/doc/Riaction/Riaction/Event/InstanceMethods.html @@ -156,9 +156,6 @@

Instance Method Details

 
 
-327
-328
-329
 330
 331
 332
@@ -189,10 +186,13 @@ 

Instance Method Details

357 358 359 -360
+360 +361 +362 +363
-
# File 'lib/riaction/riaction.rb', line 327
+      
# File 'lib/riaction/riaction.rb', line 330
 
 def riaction_event_params
   resolved_hash = {}
@@ -268,14 +268,14 @@ 

Returns:

 
 
-362
-363
-364
 365
-366
+366 +367 +368 +369
-
# File 'lib/riaction/riaction.rb', line 362
+      
# File 'lib/riaction/riaction.rb', line 365
 
 def riaction_log_event?(name)
   riaction_resolve_param self.class.riaction_events.fetch(name)[:guard]
@@ -292,7 +292,7 @@ 

Returns:

diff --git a/doc/Riaction/Riaction/InstanceMethods.html b/doc/Riaction/Riaction/InstanceMethods.html index 37aecee..1ecdf6d 100644 --- a/doc/Riaction/Riaction/InstanceMethods.html +++ b/doc/Riaction/Riaction/InstanceMethods.html @@ -135,9 +135,6 @@

Instance Method Details

 
 
-196
-197
-198
 199
 200
 201
@@ -154,10 +151,13 @@ 

Instance Method Details

212 213 214 -215
+215 +216 +217 +218
-
# File 'lib/riaction/riaction.rb', line 196
+      
# File 'lib/riaction/riaction.rb', line 199
 
 def riaction_resolve_param(poly)
   case poly
@@ -189,7 +189,7 @@ 

Instance Method Details

diff --git a/doc/Riaction/Riaction/Profile.html b/doc/Riaction/Riaction/Profile.html index 52419f0..3123f97 100644 --- a/doc/Riaction/Riaction/Profile.html +++ b/doc/Riaction/Riaction/Profile.html @@ -99,7 +99,7 @@

Defined Under Namespace

diff --git a/doc/Riaction/Riaction/Profile/InstanceMethods.html b/doc/Riaction/Riaction/Profile/InstanceMethods.html index 8e57695..23ca5ee 100644 --- a/doc/Riaction/Riaction/Profile/InstanceMethods.html +++ b/doc/Riaction/Riaction/Profile/InstanceMethods.html @@ -326,18 +326,18 @@

Instance Method Details

 
 
-257
-258
-259
 260
 261
 262
 263
 264
-265
+265 +266 +267 +268
-
# File 'lib/riaction/riaction.rb', line 257
+      
# File 'lib/riaction/riaction.rb', line 260
 
 def riaction_profile_achievements(filter_type=nil)
   @iactionable_api ||= IActionable::Api.new
@@ -366,18 +366,18 @@ 

Instance Method Details

 
 
-267
-268
-269
 270
 271
 272
 273
 274
-275
+275 +276 +277 +278
-
# File 'lib/riaction/riaction.rb', line 267
+      
# File 'lib/riaction/riaction.rb', line 270
 
 def riaction_profile_challenges(filter_type=nil)
   @iactionable_api ||= IActionable::Api.new
@@ -406,14 +406,14 @@ 

Instance Method Details

 
 
-237
-238
-239
 240
-241
+241 +242 +243 +244
-
# File 'lib/riaction/riaction.rb', line 237
+      
# File 'lib/riaction/riaction.rb', line 240
 
 def riaction_profile_display_name
   riaction_resolve_param self.class.riaction_profile_keys.fetch(riaction_use_profile)[:display_name]
@@ -438,18 +438,18 @@ 

Instance Method Details

 
 
-277
-278
-279
 280
 281
 282
 283
 284
-285
+285 +286 +287 +288
-
# File 'lib/riaction/riaction.rb', line 277
+      
# File 'lib/riaction/riaction.rb', line 280
 
 def riaction_profile_goals(filter_type=nil)
   @iactionable_api ||= IActionable::Api.new
@@ -478,19 +478,19 @@ 

Instance Method Details

 
 
-220
-221
-222
 223
 224
 225
 226
 227
 228
-229
+229 +230 +231 +232
-
# File 'lib/riaction/riaction.rb', line 220
+      
# File 'lib/riaction/riaction.rb', line 223
 
 def riaction_profile_keys
   resolved_hash = {}
@@ -520,18 +520,18 @@ 

Instance Method Details

 
 
-287
-288
-289
 290
 291
 292
 293
 294
-295
+295 +296 +297 +298
-
# File 'lib/riaction/riaction.rb', line 287
+      
# File 'lib/riaction/riaction.rb', line 290
 
 def riaction_profile_notifications
   @iactionable_api ||= IActionable::Api.new
@@ -560,18 +560,18 @@ 

Instance Method Details

 
 
-297
-298
-299
 300
 301
 302
 303
 304
-305
+305 +306 +307 +308
-
# File 'lib/riaction/riaction.rb', line 297
+      
# File 'lib/riaction/riaction.rb', line 300
 
 def riaction_profile_points(point_type)
   @iactionable_api ||= IActionable::Api.new
@@ -611,18 +611,18 @@ 

Instance Method Details

 
 
-247
-248
-249
 250
 251
 252
 253
 254
-255
+255 +256 +257 +258
-
# File 'lib/riaction/riaction.rb', line 247
+      
# File 'lib/riaction/riaction.rb', line 250
 
 def riaction_profile_summary(achievement_count=nil)
   @iactionable_api ||= IActionable::Api.new
@@ -673,14 +673,14 @@ 

Raises:

 
 
-231
-232
-233
 234
-235
+235 +236 +237 +238
-
# File 'lib/riaction/riaction.rb', line 231
+      
# File 'lib/riaction/riaction.rb', line 234
 
 def riaction_set_profile(type)
   raise RuntimeError.new("#{self.to_s} does not define a profile type #{type}") unless riaction_profile_keys.has_key?(type)
@@ -705,18 +705,18 @@ 

Raises:

 
 
-307
-308
-309
 310
 311
 312
 313
 314
-315
+315 +316 +317 +318
-
# File 'lib/riaction/riaction.rb', line 307
+      
# File 'lib/riaction/riaction.rb', line 310
 
 def riaction_update_profile_points(point_type, amount, reason="")
   @iactionable_api ||= IActionable::Api.new
@@ -737,7 +737,7 @@ 

Raises:

diff --git a/doc/Riaction/RuntimeError.html b/doc/Riaction/RuntimeError.html index 01f51db..29b8d49 100644 --- a/doc/Riaction/RuntimeError.html +++ b/doc/Riaction/RuntimeError.html @@ -107,7 +107,7 @@ diff --git a/doc/RiactionGenerator.html b/doc/RiactionGenerator.html index 0802b1e..b229ed1 100644 --- a/doc/RiactionGenerator.html +++ b/doc/RiactionGenerator.html @@ -179,7 +179,7 @@

Instance Method Details

diff --git a/doc/_index.html b/doc/_index.html index 757c47c..8e098e2 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -123,13 +123,6 @@

Namespace Listing A-Z

-
  • - EventPerformer - - (Riaction) - -
  • - @@ -139,23 +132,23 @@

    Namespace Listing A-Z

    • - InstanceMethods + InstanceMethods - (Riaction::Riaction::Profile) + (Riaction::Riaction)
    • - InstanceMethods + InstanceMethods - (Riaction::Riaction::Event) + (Riaction::Riaction::Profile)
    • - InstanceMethods + InstanceMethods - (Riaction::Riaction) + (Riaction::Riaction::Event)
    • @@ -261,7 +254,7 @@

      Namespace Listing A-Z

      diff --git a/doc/class_list.html b/doc/class_list.html index 9cb2520..08fcdab 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -39,7 +39,7 @@

      Class List

      diff --git a/doc/file.README.html b/doc/file.README.html index 581a3cc..90fa019 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -295,7 +295,7 @@

      Authors

      diff --git a/doc/index.html b/doc/index.html index 581a3cc..90fa019 100644 --- a/doc/index.html +++ b/doc/index.html @@ -295,7 +295,7 @@

      Authors

      diff --git a/doc/method_list.html b/doc/method_list.html index 5aab294..e65071c 100644 --- a/doc/method_list.html +++ b/doc/method_list.html @@ -121,14 +121,6 @@

      Method List

    • - perform - - Riaction::EventPerformer - -
    • - - -
    • perform Riaction::ProfileCreator @@ -136,7 +128,7 @@

      Method List

    • -
    • +
    • retry_attempts_for_internal_error Riaction::Constants @@ -144,7 +136,7 @@

      Method List

    • -
    • +
    • #riaction Riaction::Riaction::ClassMethods @@ -152,7 +144,7 @@

      Method List

    • -
    • +
    • #riaction_event_params Riaction::Riaction::Event::InstanceMethods @@ -160,7 +152,7 @@

      Method List

    • -
    • +
    • #riaction_events? Riaction::Riaction::ClassMethods @@ -168,7 +160,7 @@

      Method List

    • -
    • +
    • #riaction_log_event? Riaction::Riaction::Event::InstanceMethods @@ -176,7 +168,7 @@

      Method List

    • -
    • +
    • riaction_options Riaction::Constants @@ -184,7 +176,7 @@

      Method List

    • -
    • +
    • #riaction_profile? Riaction::Riaction::ClassMethods @@ -192,7 +184,7 @@

      Method List

    • -
    • +
    • #riaction_profile_achievements Riaction::Riaction::Profile::InstanceMethods @@ -200,7 +192,7 @@

      Method List

    • -
    • +
    • #riaction_profile_challenges Riaction::Riaction::Profile::InstanceMethods @@ -208,7 +200,7 @@

      Method List

    • -
    • +
    • #riaction_profile_display_name Riaction::Riaction::Profile::InstanceMethods @@ -216,7 +208,7 @@

      Method List

    • -
    • +
    • #riaction_profile_goals Riaction::Riaction::Profile::InstanceMethods @@ -224,7 +216,7 @@

      Method List

    • -
    • +
    • #riaction_profile_keys Riaction::Riaction::Profile::InstanceMethods @@ -232,7 +224,7 @@

      Method List

    • -
    • +
    • #riaction_profile_notifications Riaction::Riaction::Profile::InstanceMethods @@ -240,7 +232,7 @@

      Method List

    • -
    • +
    • #riaction_profile_points Riaction::Riaction::Profile::InstanceMethods @@ -248,7 +240,7 @@

      Method List

    • -
    • +
    • #riaction_profile_summary Riaction::Riaction::Profile::InstanceMethods @@ -256,7 +248,7 @@

      Method List

    • -
    • +
    • #riaction_resolve_param Riaction::Riaction::InstanceMethods @@ -264,7 +256,7 @@

      Method List

    • -
    • +
    • #riaction_set_profile Riaction::Riaction::Profile::InstanceMethods @@ -272,7 +264,7 @@

      Method List

    • -
    • +
    • #riaction_update_profile_points Riaction::Riaction::Profile::InstanceMethods @@ -280,7 +272,7 @@

      Method List

    • -
    • +
    • #riactionary? Riaction::Riaction::ClassMethods @@ -288,7 +280,7 @@

      Method List

    • -
    • +
    • supported_identifier_types Riaction::Constants diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index a849e30..dd6fa4a 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -98,7 +98,7 @@

      Defined Under Namespace

      diff --git a/lib/riaction/constants.rb b/lib/riaction/constants.rb index afe98d6..0d9b956 100644 --- a/lib/riaction/constants.rb +++ b/lib/riaction/constants.rb @@ -1,13 +1,17 @@ module Riaction class Constants + # sets the default actions to be considered as part of riaction def self.crud_actions Set.new [:create, :update, :destroy] end - + + # sets the default number of attempts to retry a action incase of an internal error def self.retry_attempts_for_internal_error 3 end - + + # sets the valid supported identifiers + # @return returns an array of symbols def self.supported_identifier_types [:email,:username,:custom,:facebook,:twitter,:salesforce] end diff --git a/lib/riaction/crud_event_callback.rb b/lib/riaction/crud_event_callback.rb index 58cbb14..144358f 100644 --- a/lib/riaction/crud_event_callback.rb +++ b/lib/riaction/crud_event_callback.rb @@ -7,18 +7,21 @@ def initialize(event_name) @event_name = event_name end + # Enqueues a Riaction::EventPerformer object in resque after a model has been created def after_create(record) if record.riaction_log_event?(@event_name) && !record.class.riactionless? Resque.enqueue(::Riaction::EventPerformer, @event_name, record.class.base_class.to_s, record.id) end end + # Enqueues a Riaction::EventPerformer object in resque after a model has been updated def after_update(record) if record.riaction_log_event?(@event_name) && !record.class.riactionless? Resque.enqueue(::Riaction::EventPerformer, @event_name, record.class.base_class.to_s, record.id) end end + # Enqueues a Riaction::EventPerformer object in resque after a model has been destroyed def after_destroy(record) if record.riaction_log_event?(@event_name) && !record.class.riactionless? Resque.enqueue(::Riaction::EventPerformer, @event_name, record.class.base_class.to_s, record.id) diff --git a/lib/riaction/event_performer.rb b/lib/riaction/event_performer.rb index 07ec6a4..051fa86 100644 --- a/lib/riaction/event_performer.rb +++ b/lib/riaction/event_performer.rb @@ -5,7 +5,7 @@ module Riaction class EventPerformer @queue = :riaction_event_logger - def self.perform(event_name, klass_name, id, attempt=0) + # Sends an event to IActionable based on the name of a riaction class and the ID used to locate the instance event_name_sym = event_name.to_sym iactionable_api = IActionable::Api.new event_object = klass_name.constantize.find_by_id!(id) diff --git a/lib/riaction/profile_creation_callback.rb b/lib/riaction/profile_creation_callback.rb index 436e316..58d9e57 100644 --- a/lib/riaction/profile_creation_callback.rb +++ b/lib/riaction/profile_creation_callback.rb @@ -3,6 +3,8 @@ module Riaction class ProfileCreationCallback + + # Enqueue a Riaction::ProfileCreatore object in resque def after_create(record) Resque.enqueue(::Riaction::ProfileCreator, record.class.base_class.to_s, record.id) unless record.class.riactionless? end diff --git a/lib/riaction/riaction.rb b/lib/riaction/riaction.rb index 6299f04..2f0ca0d 100644 --- a/lib/riaction/riaction.rb +++ b/lib/riaction/riaction.rb @@ -38,8 +38,11 @@ def riaction(type, opts) end end + # Patches a class to turn it into a riactionary class, providing some default checks and attributes def establish_riactionary_class class << self + + # returns true if a class has riaction setup def riactionary? true end diff --git a/riaction.gemspec b/riaction.gemspec index 37a0c45..01e6430 100644 --- a/riaction.gemspec +++ b/riaction.gemspec @@ -5,9 +5,9 @@ require "riaction/version" Gem::Specification.new do |s| s.name = "riaction" s.version = Riaction::VERSION - s.authors = ["Chris Eberz"] + s.authors = ["Chris Eberz", "Katie Miller", "Nicholas Audo"] s.email = ["ceberz@elctech.com"] - s.homepage = "" + s.homepage = "https://github.com/zortnac/riaction/" s.summary = %q{Wrapper for IActionable's restful API and an "acts-as" style interface for models to behave as profiles and drive game events.} s.description = %q{Wrapper for IActionable's restful API and an "acts-as" style interface for models to behave as profiles and drive game events.}