Class: DBD4::ForeignKeyField

Inherits:
Object
  • Object
show all
Defined in:
lib/dbd4/dbd4_model_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fkfield_string) ⇒ ForeignKeyField

Returns a new instance of ForeignKeyField.



247
248
249
# File 'lib/dbd4/dbd4_model_file.rb', line 247

def initialize(fkfield_string)
  @source_field, @destination_field = fkfield_string.split(/=/)
end

Instance Attribute Details

#destination_fieldObject (readonly)

Returns the value of attribute destination_field.



245
246
247
# File 'lib/dbd4/dbd4_model_file.rb', line 245

def destination_field
  @destination_field
end

#source_fieldObject (readonly)

Returns the value of attribute source_field.



245
246
247
# File 'lib/dbd4/dbd4_model_file.rb', line 245

def source_field
  @source_field
end

Instance Method Details

#to_strObject



251
252
253
# File 'lib/dbd4/dbd4_model_file.rb', line 251

def to_str
  "#{source_field} => #{destination_field}"
end