Sha256: ba1eecc48aa1b8016aebd91efb6d5d4576f057feff0155369ac58e04498700e1

Contents?: true

Size: 592 Bytes

Versions: 7

Compression:

Stored size: 592 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)
            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

7 entries across 7 versions & 1 rubygems

Version Path
vines-0.3.2 lib/vines/stream/server/outbound/final_features.rb
vines-0.3.1 lib/vines/stream/server/outbound/final_features.rb
vines-0.3.0 lib/vines/stream/server/outbound/final_features.rb
vines-0.2.1 lib/vines/stream/server/outbound/final_features.rb
vines-0.2.0 lib/vines/stream/server/outbound/final_features.rb
vines-0.1.1 lib/vines/stream/server/outbound/final_features.rb
vines-0.1.0 lib/vines/stream/server/outbound/final_features.rb