Sha256: 2bd5d792150497329896555e73321e75931513303fb2b2ca5020ec4e44f89890
Contents?: true
Size: 1.15 KB
Versions: 18
Compression:
Stored size: 1.15 KB
Contents
module Expressir module Model class Entity include Scope include Identifier attr_accessor :abstract attr_accessor :supertype_expression attr_accessor :subtype_of attr_accessor :attributes attr_accessor :unique attr_accessor :where def initialize(options = {}) @id = options[:id] @abstract = options[:abstract] @supertype_expression = options[:supertype_expression] @subtype_of = options[:subtype_of] @attributes = options[:attributes] @unique = options[:unique] @where = options[:where] end def explicit_attributes @attributes.select{|x| x.kind == Expressir::Model::Attribute::EXPLICIT} end def derived_attributes @attributes.select{|x| x.kind == Expressir::Model::Attribute::DERIVED} end def inverse_attributes @attributes.select{|x| x.kind == Expressir::Model::Attribute::INVERSE} end def children items = [] items.push(*@attributes) if @attributes items.push(*@unique) if @unique items.push(*@where) if @where items end end end end
Version data entries
18 entries across 18 versions & 1 rubygems