Sha256: 16d9e2a3a056bb77d6e66f5e1a0b717f04bb8c8528af84778177dbfeb76bdfdf

Contents?: true

Size: 628 Bytes

Versions: 27

Compression:

Stored size: 628 Bytes

Contents

# encoding: UTF-8

module Vines
  class Stream
    class Server
      class Outbound
        class FinalFeatures < State
          def initialize(stream, success=Server::Ready)
            super
          end

          def node(node)
            raise StreamErrors::NotAuthorized unless empty_features?(node)
            stream.router << stream
            advance
            stream.notify_connected
          end

          private

          def empty_features?(node)
            node.name == 'features' && namespace(node) == NAMESPACES[:stream] && node.elements.empty?
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
vinesmod-0.4.5 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.5 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.4 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.3 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.2 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.1 lib/vines/stream/server/outbound/final_features.rb
vines-0.4.0 lib/vines/stream/server/outbound/final_features.rb