Sha256: 912095090f3da7c10fd1e51f8157c5b4693dfc93de7dcd73c2301c81ffae0b2d

Contents?: true

Size: 935 Bytes

Versions: 2

Compression:

Stored size: 935 Bytes

Contents

module RdbmsSampler
  class Dependency

    attr_reader :parent_schema
    attr_reader :parent_table
    attr_reader :parent_key
    attr_reader :child_schema_name
    attr_reader :child_table_name
    attr_reader :child_key
    attr_reader :value

    def initialize(parent_schema, parent_table, parent_key, child_schema, child_table, child_key, value)
      @parent_schema = parent_schema
      @parent_table = parent_table
      @parent_key = parent_key
      @child_schema_name = child_schema
      @child_table_name = child_table
      @child_key = child_key
      @value = value
    end

    def identifier
      "#{child_schema_name}.#{child_table_name}"
    end

    def eql? other
      identifier == other.identifier and child_key == other.child_key and value == other.value
    end

    def to_s
      "reference from #{parent_schema}.#{parent_table}.#{parent_key} to #{identifier}[#{child_key}=#{value}]"
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdbms_sampler-1.2.0 lib/rdbms_sampler/dependency.rb
rdbms_sampler-1.1.1 lib/rdbms_sampler/dependency.rb