Module: Mumukit::Platform::Notifiable
- Defined in:
- lib/mumukit/platform/notifiable.rb
Instance Method Summary collapse
- #as_platform_event ⇒ Object
- #notify!(event_type = :changed) ⇒ Object
- #platform_event_name(event_type) ⇒ Object
Instance Method Details
#as_platform_event ⇒ Object
10 11 12 |
# File 'lib/mumukit/platform/notifiable.rb', line 10 def as_platform_event { platform_class_name.downcase => to_resource_h } end |
#notify!(event_type = :changed) ⇒ Object
2 3 4 |
# File 'lib/mumukit/platform/notifiable.rb', line 2 def notify!(event_type = :changed) Mumukit::Nuntius.notify_event! platform_event_name(event_type), as_platform_event end |
#platform_event_name(event_type) ⇒ Object
6 7 8 |
# File 'lib/mumukit/platform/notifiable.rb', line 6 def platform_event_name(event_type) "#{platform_class_name}#{event_type.to_s.titlecase}" end |