Module: Roguelytics::HasRoguelytics::LocalInstanceMethods
- Defined in:
- lib/roguelytics/has_roguelytics.rb
Instance Method Summary collapse
- #roguelytics_create ⇒ Object
- #roguelytics_delete ⇒ Object
- #roguelytics_get(event, params) ⇒ Object
- #roguelytics_params ⇒ Object
- #roguelytics_update ⇒ Object
Instance Method Details
#roguelytics_create ⇒ Object
43 44 45 |
# File 'lib/roguelytics/has_roguelytics.rb', line 43 def roguelytics_create self.roguelytics_get 'create', roguelytics_params end |
#roguelytics_delete ⇒ Object
51 52 53 |
# File 'lib/roguelytics/has_roguelytics.rb', line 51 def roguelytics_delete self.roguelytics_get 'delete', roguelytics_params end |
#roguelytics_get(event, params) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/roguelytics/has_roguelytics.rb', line 31 def roguelytics_get event, params if Rails.env.development? Roguelytics::ProcessJob.perform_now event, params rescue nil else Roguelytics::ProcessJob.perform_later event, params rescue nil end end |
#roguelytics_params ⇒ Object
39 40 41 |
# File 'lib/roguelytics/has_roguelytics.rb', line 39 def roguelytics_params params = { model_name: self.class.to_s, id: self.id, created_at: "#{self.created_at.to_s}", name: (self.name rescue nil) } end |
#roguelytics_update ⇒ Object
47 48 49 |
# File 'lib/roguelytics/has_roguelytics.rb', line 47 def roguelytics_update self.roguelytics_get 'update', roguelytics_params end |