Class: Schemacop::NodeResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/schemacop/node_resolver.rb

Class Method Summary collapse

Class Method Details

.register(node_class) ⇒ Object



6
7
8
# File 'lib/schemacop/node_resolver.rb', line 6

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

.resolve(type) ⇒ Object



10
11
12
# File 'lib/schemacop/node_resolver.rb', line 10

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