Sha256: fdf895bd9492f0e1adc537ac7d82384ad54eab3a0b10856d23ed4d2963947711

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

module Expressir
  module Model
    class Entity
      attr_accessor :id
      attr_accessor :abstract
      attr_accessor :abstract_supertype
      attr_accessor :supertypes
      attr_accessor :subtype_expression
      attr_accessor :explicit
      attr_accessor :derived
      attr_accessor :inverse
      attr_accessor :unique
      attr_accessor :where
      attr_accessor :remarks

      def initialize(options = {})
        @id = options[:id]
        @abstract = options[:abstract]
        @abstract_supertype = options[:abstract_supertype]
        @supertypes = options[:supertypes]
        @subtype_expression = options[:subtype_expression]
        @explicit = options[:explicit]
        @derived = options[:derived]
        @inverse = options[:inverse]
        @unique = options[:unique]
        @where = options[:where]
        @remarks = options[:remarks]
      end

      def scope_items
        items = []
        items.push(*@explicit) if @explicit
        items.push(*@derived) if @derived
        items.push(*@inverse) if @inverse
        items.push(*@unique) if @unique
        items.push(*@where) if @where
        items
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
expressir-0.2.2 lib/expressir/model/entity.rb
expressir-0.2.1 lib/expressir/model/entity.rb