Class: Dart::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/dart/core/association.rb

Direct Known Subclasses

DirectAssociation, ManyToManyAssociation

Constant Summary collapse

ONE_TO_ONE_TYPE =
:one_to_one
ONE_TO_MANY_TYPE =
:one_to_many
MANY_TO_ONE_TYPE =
:many_to_one
MANY_TO_MANY_TYPE =
:many_to_many

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#model_classObject

used by ORM implementations to store the associated ORM model class and association options



10
11
12
# File 'lib/dart/core/association.rb', line 10

def model_class
  @model_class
end

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/dart/core/association.rb', line 15

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



11
12
13
# File 'lib/dart/core/association.rb', line 11

def scope
  @scope
end

Instance Method Details

#set_name!(ass_name) ⇒ Object

Parameters:

  • ass_name (String|Symbol)


18
19
20
# File 'lib/dart/core/association.rb', line 18

def set_name!(ass_name)
  @name = ass_name.to_s
end

#to_one?Boolean

can be overriddent by *_to_one association types

Returns:

  • (Boolean)


23
24
25
# File 'lib/dart/core/association.rb', line 23

def to_one?
  false
end