Sha256: 0b54a2d02132c536afb467441025d441a7755d0f40db219783a71494c7fb801e

Contents?: true

Size: 289 Bytes

Versions: 6

Compression:

Stored size: 289 Bytes

Contents

module Schemacop
  class NodeResolver
    class_attribute :node_classes
    self.node_classes = [].freeze

    def self.register(node_class)
      self.node_classes += [node_class]
    end

    def self.resolve(type)
      node_classes.find { |c| c.type_matches?(type) }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
schemacop-2.3.2 lib/schemacop/node_resolver.rb
schemacop-2.3.1 lib/schemacop/node_resolver.rb
schemacop-2.3.0 lib/schemacop/node_resolver.rb
schemacop-2.2.0 lib/schemacop/node_resolver.rb
schemacop-2.1.0 lib/schemacop/node_resolver.rb
schemacop-2.0.0 lib/schemacop/node_resolver.rb