Sha256: 7f279768959ebc6a96b46d078ba0a7aa2c3266b1a574734f8ebc2eb7d99b0fd2

Contents?: true

Size: 367 Bytes

Versions: 2

Compression:

Stored size: 367 Bytes

Contents

module Ahnnotate
  class ForeignKey
    attr_accessor :name
    attr_accessor :from_column
    attr_accessor :to_table
    attr_accessor :to_column

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

    def from
      from_column
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ahnnotate-0.5.1 lib/ahnnotate/foreign_key.rb
ahnnotate-0.5.0 lib/ahnnotate/foreign_key.rb