jam-cloud/ruby/lib/jam_ruby/lib/subscription_message.rb

26 lines
947 B
Ruby

module JamRuby
class SubscriptionMessage
# sent whenever we change the desired direction of the source
def self.mount_source_direction(mount)
Notification.send_subscription_message('mount', mount.id, {type: 'source_direction_change', source_direction: true}.to_json)
end
# sent whenever we receive an update about a sourcing attempt by a client
# source_change_json is created by a rabl, so currently only possible to use via web
def self.mount_source_change(mount, source_change_json)
Notification.send_subscription_message('mount', mount.id, source_change_json)
end
def self.mount_source_up_requested(mount)
Notification.send_subscription_message('mount', mount.id, {type: 'source_up_requested'}.to_json )
end
def self.mount_source_down_requested(mount)
Notification.send_subscription_message('mount', mount.id, {type: 'source_down_requested'}.to_json )
end
end
end