Class: Ahnnotate::ForeignKey

Inherits:
Object
  • Object
show all
Defined in:
lib/ahnnotate/foreign_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ForeignKey

Returns a new instance of ForeignKey.



8
9
10
11
12
# File 'lib/ahnnotate/foreign_key.rb', line 8

def initialize(**args)
  args.each do |key, value|
    public_send("#{key}=", value)
  end
end

Instance Attribute Details

#from_columnObject

Returns the value of attribute from_column.



4
5
6
# File 'lib/ahnnotate/foreign_key.rb', line 4

def from_column
  @from_column
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/ahnnotate/foreign_key.rb', line 3

def name
  @name
end

#to_columnObject

Returns the value of attribute to_column.



6
7
8
# File 'lib/ahnnotate/foreign_key.rb', line 6

def to_column
  @to_column
end

#to_tableObject

Returns the value of attribute to_table.



5
6
7
# File 'lib/ahnnotate/foreign_key.rb', line 5

def to_table
  @to_table
end

Instance Method Details

#fromObject



14
15
16
# File 'lib/ahnnotate/foreign_key.rb', line 14

def from
  from_column
end

#toObject



18
19
20
# File 'lib/ahnnotate/foreign_key.rb', line 18

def to
  "#{to_table}##{to_column}"
end