Class: Class

Inherits:
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.



55
56
57
58
59
60
61
# File 'lib/activefacts/api/standard_types.rb', line 55

def identified_by *args, &b
  raise "#{basename} is not an entity type" 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



63
64
65
# File 'lib/activefacts/api/standard_types.rb', line 63

def is_entity_type
  respond_to?(:identifying_role_names)
end