Class: Foobara::Manifest::Entity

Inherits:
DetachedEntity show all
Defined in:
foobara-0.0.110/projects/manifest/src/foobara/manifest/entity.rb

Instance Attribute Summary

Attributes inherited from Foobara::Model

#mutable

Instance Method Summary collapse

Methods inherited from DetachedEntity

install!, reset_all

Methods included from DetachedEntity::Concerns::Serialize

#inspect, #to_json

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Methods included from DetachedEntity::Concerns::PrimaryKey

#primary_key

Methods included from DetachedEntity::Concerns::Equality

#==, #dup, #hash

Methods inherited from Foobara::Model

#==, abstract, abstract?, attribute_names, #attributes, #attributes_with_delegates, #cast_attribute, #cast_attribute!, closest_namespace_module, description, domain, domain_name, #eql?, foobara_model_name, foobara_name, full_model_name, #hash, #initialize, install!, organization_name, possible_errors, #read_attribute, #read_attribute!, reset_all, subclass, #to_h, #to_json, #valid?, valid_attribute_name?, #validate!, validate_attribute_name!, #validation_errors, #write_attribute, #write_attribute!, #write_attributes, #write_attributes!

Constructor Details

This class inherits a constructor from Foobara::Model

Instance Method Details

#associationsObject

TODO: should this instead be on DetachedEntity??



20
21
22
23
24
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/entity.rb', line 20

def associations
  @associations ||= self[:associations].to_h do |path_key, type_name|
    [path_key.to_sym, Type.new(root_manifest, [:type, type_name])]
  end
end

#full_entity_nameObject



15
16
17
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/entity.rb', line 15

def full_entity_name
  full_model_name
end

#has_associations?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/entity.rb', line 11

def has_associations?
  associations && !associations.empty?
end