Class: ForeignKeyChecker::Utils::BelongsTo::WayPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/foreign_key_checker/utils/belongs_to.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(foreign_key, table) ⇒ WayPoint

Returns a new instance of WayPoint.



493
494
495
496
# File 'lib/foreign_key_checker/utils/belongs_to.rb', line 493

def initialize(foreign_key, table)
  @foreign_key = foreign_key
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



492
493
494
# File 'lib/foreign_key_checker/utils/belongs_to.rb', line 492

def table
  @table
end

Instance Method Details

#==(value) ⇒ Object



504
505
506
507
508
# File 'lib/foreign_key_checker/utils/belongs_to.rb', line 504

def ==(value)
  return @table == value if value.is_a?(String)

  value.table == @table
end

#inspectObject



498
499
500
501
502
# File 'lib/foreign_key_checker/utils/belongs_to.rb', line 498

def inspect
  return @table if @foreign_key.blank?

  "->#{@foreign_key}(#{@table})"
end