Sha256: e6c1b8c8a7198a68859edbe94ade4cfc042a032766ffb702c8780f576d5ca34c
Contents?: true
Size: 1.74 KB
Versions: 7
Compression:
Stored size: 1.74 KB
Contents
module Expressir module Model class Schema include Scope include Identifier attr_accessor :version attr_accessor :interfaces attr_accessor :constants attr_accessor :declarations attr_accessor :head_source def initialize(options = {}) @id = options[:id] @version = options[:version] @interfaces = options[:interfaces] @constants = options[:constants] @declarations = options[:declarations] end def use_interfaces @interfaces.select{|x| x.kind == Expressir::Model::Interface::USE} end def reference_interfaces @interfaces.select{|x| x.kind == Expressir::Model::Interface::REFERENCE} end def types @declarations.select{|x| x.instance_of? Expressir::Model::Type} end def entities @declarations.select{|x| x.instance_of? Expressir::Model::Entity} end def subtype_constraints @declarations.select{|x| x.instance_of? Expressir::Model::SubtypeConstraint} end def functions @declarations.select{|x| x.instance_of? Expressir::Model::Function} end def procedures @declarations.select{|x| x.instance_of? Expressir::Model::Procedure} end def rules @declarations.select{|x| x.instance_of? Expressir::Model::Rule} end def children items = [] items.push(*@constants) if @constants items.push(*@declarations.flat_map do |x| [ x, *if x.instance_of? Expressir::Model::Type and x.type.instance_of? Expressir::Model::Types::Enumeration x.type.items end ] end) if @declarations items end end end end
Version data entries
7 entries across 7 versions & 1 rubygems