Class: DMap::Associations::HasMany

Inherits:
Object
  • Object
show all
Defined in:
lib/dmap/associations/hasn.rb

Direct Known Subclasses

Hasmany

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#associationsObject

Returns the value of attribute associations.



30
31
32
# File 'lib/dmap/associations/hasn.rb', line 30

def associations
  @associations
end

Class Method Details

.associationsObject



32
# File 'lib/dmap/associations/hasn.rb', line 32

def self.associations; true; end

.fieldObject



38
39
40
# File 'lib/dmap/associations/hasn.rb', line 38

def self.field
  "has n, "
end

.is_valid?(command = nil) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/dmap/associations/hasn.rb', line 42

def self.is_valid?(command=nil)
  (!command.nil? or command)
end

.parent_nameObject



34
35
36
# File 'lib/dmap/associations/hasn.rb', line 34

def self.parent_name
  "HasMany"
end

.validate(command = nil) ⇒ Object



46
47
48
49
50
# File 'lib/dmap/associations/hasn.rb', line 46

def self.validate(command=nil)
  command = command.split('-')
  command[1] = nil if command[1].nil?
  {:fields => command[0].underscore.to_sym, :through => command[1]}
end