Sha256: e42933de99efed49697d5851cf90c586e735177ed977196185655ece33b32f66
Contents?: true
Size: 749 Bytes
Versions: 8
Compression:
Stored size: 749 Bytes
Contents
module Schemacop module V3 # @abstract class CombinationNode < Node def self.dsl_methods super + NodeRegistry.dsl_methods(false) end supports_children def init @items = [] end def as_json process_json([], type => @items.map(&:as_json)) end def cast(value) item = match(value) return value unless item return item.cast(value) end def add_child(node) @items << node end protected def type fail NotImplementedError end def match(data) matches(data).first end def matches(data) @items.select { |i| item_matches?(i, data) } end end end end
Version data entries
8 entries across 8 versions & 1 rubygems