Sha256: 1334cf4bdefbdb41fb8c2759d756aa7aa65c7ef3881037174086cb7174f241f3

Contents?: true

Size: 302 Bytes

Versions: 5

Compression:

Stored size: 302 Bytes

Contents

module Phoenix
  class Push
    include Native

    def initialize(push)
      super(push)
    end

    def receive(msg, &block)
      Push.new `#{@native}.receive(#{msg}, #{callback(block)})`
    end

    def callback(block)
      proc do |e|
        block.call(Native(e))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-phoenix-0.0.7 opal/phoenix/push.rb
opal-phoenix-0.0.6 opal/phoenix/push.rb
opal-phoenix-0.0.5 opal/phoenix/push.rb
opal-phoenix-0.0.4 opal/phoenix/push.rb
opal-phoenix-0.0.3 opal/phoenix/push.rb