Class: DataMapper::RelationshipSet
- Inherits:
-
SubjectSet
- Object
- SubjectSet
- DataMapper::RelationshipSet
- Defined in:
- lib/dm-core/relationship_set.rb
Overview
A SubjectSet that keeps track of relationships defined in a Model
Instance Attribute Summary
Attributes inherited from SubjectSet
Instance Method Summary collapse
-
#each_value {|DataMapper::Associations::Relationship| ... } ⇒ RelationshipSet
deprecated
Deprecated.
use DataMapper::RelationshipSet#each instead
-
#has_key?(name) ⇒ Boolean
deprecated
Deprecated.
use DataMapper::RelationshipSet#named? instead
-
#key?(name) ⇒ Boolean
deprecated
Deprecated.
use DataMapper::RelationshipSet#named? instead
-
#values ⇒ Array
deprecated
Deprecated.
use DataMapper::RelationshipSet#each or DataMapper::RelationshipSet#to_a instead
Methods inherited from SubjectSet
#<<, #[], #clear, #delete, #each, #empty?, #include?, #initialize, #initialize_copy, #named?, #size, #to_ary, #values_at
Constructor Details
This class inherits a constructor from DataMapper::SubjectSet
Instance Method Details
#each_value {|DataMapper::Associations::Relationship| ... } ⇒ RelationshipSet
use DataMapper::RelationshipSet#each instead
A list of all relationships in this set
35 36 37 38 39 |
# File 'lib/dm-core/relationship_set.rb', line 35 def each_value warn "#{self.class}#each_value is deprecated. Use #{self.class}#each instead: #{caller.first}" each { |relationship| yield(relationship) } self end |
#has_key?(name) ⇒ Boolean
use DataMapper::RelationshipSet#named? instead
Check wether this RelationshipSet includes an entry with the given name
68 69 70 71 |
# File 'lib/dm-core/relationship_set.rb', line 68 def has_key?(name) warn "#{self.class}#has_key? is deprecated. Use #{self.class}#named? instead: #{caller.first}" named?(name) end |
#key?(name) ⇒ Boolean
use DataMapper::RelationshipSet#named? instead
Check wether this RelationshipSet includes an entry with the given name
52 53 54 55 |
# File 'lib/dm-core/relationship_set.rb', line 52 def key?(name) warn "#{self.class}#key? is deprecated. Use #{self.class}#named? instead: #{caller.first}" named?(name) end |
#values ⇒ Array
use DataMapper::RelationshipSet#each or DataMapper::RelationshipSet#to_a instead
A list of all relationships in this set
17 18 19 20 |
# File 'lib/dm-core/relationship_set.rb', line 17 def values warn "#{self.class}#values is deprecated. Use #{self.class}#each or #{self.class}#to_a instead: #{caller.first}" to_a end |