Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/activefacts/api/standard_types.rb

Instance Method Summary collapse

Instance Method Details

#identified_by(*args, &b) ⇒ Object

Make this Class into a ObjectType and if necessary its module into a Vocabulary. The parameters are the names (Symbols) of the identifying roles.



61
62
63
64
65
66
67
# File 'lib/activefacts/api/standard_types.rb', line 61

def identified_by *args, &b
  raise ActiveFacts::API::InvalidEntityException.new(self) if respond_to? :value_type  # Don't make a ValueType into an EntityType

  # The inclusion of instance methods triggers ClassMethods to be included in the class too
  include ActiveFacts::API::Entity
  identified_by(*args, &b)
end

#is_entity_typeObject



69
70
71
# File 'lib/activefacts/api/standard_types.rb', line 69

def is_entity_type
  respond_to?(:identifying_role_names)
end