Sha256: dae9672fc7ce40e26b16562b62d12a69f096ebaf3f7d0b74fff6ad9c53685d2a
Contents?: true
Size: 790 Bytes
Versions: 135
Compression:
Stored size: 790 Bytes
Contents
require "expressir/express/named_type" module Expressir module Express class DefinedType < NamedType def initialize(options = {}) @options = options @schema = options.fetch(:schema) end def parse document = @options.fetch(:document) extract_type_attributes(document) self end def self.parse(document, schema) new(document: document, schema: schema).parse end private def extract_type_attributes(document) @name = document.attributes["name"].to_s @wheres = extract_where_rules(document) end def extract_where_rules(document) document.xpath("where").map do |where| Express::WhereRule.parse(where) end end end end end
Version data entries
135 entries across 135 versions & 1 rubygems