Class: RdbmsSampler::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/rdbms_sampler/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_schema, parent_table, parent_key, child_schema, child_table, child_key, value) ⇒ Dependency

Returns a new instance of Dependency.



12
13
14
15
16
17
18
19
20
# File 'lib/rdbms_sampler/dependency.rb', line 12

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

Instance Attribute Details

#child_keyObject (readonly)

Returns the value of attribute child_key.



9
10
11
# File 'lib/rdbms_sampler/dependency.rb', line 9

def child_key
  @child_key
end

#child_schema_nameObject (readonly)

Returns the value of attribute child_schema_name.



7
8
9
# File 'lib/rdbms_sampler/dependency.rb', line 7

def child_schema_name
  @child_schema_name
end

#child_table_nameObject (readonly)

Returns the value of attribute child_table_name.



8
9
10
# File 'lib/rdbms_sampler/dependency.rb', line 8

def child_table_name
  @child_table_name
end

#parent_keyObject (readonly)

Returns the value of attribute parent_key.



6
7
8
# File 'lib/rdbms_sampler/dependency.rb', line 6

def parent_key
  @parent_key
end

#parent_schemaObject (readonly)

Returns the value of attribute parent_schema.



4
5
6
# File 'lib/rdbms_sampler/dependency.rb', line 4

def parent_schema
  @parent_schema
end

#parent_tableObject (readonly)

Returns the value of attribute parent_table.



5
6
7
# File 'lib/rdbms_sampler/dependency.rb', line 5

def parent_table
  @parent_table
end

#valueObject (readonly)

Returns the value of attribute value.



10
11
12
# File 'lib/rdbms_sampler/dependency.rb', line 10

def value
  @value
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rdbms_sampler/dependency.rb', line 26

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

#identifierObject



22
23
24
# File 'lib/rdbms_sampler/dependency.rb', line 22

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

#to_sObject



30
31
32
# File 'lib/rdbms_sampler/dependency.rb', line 30

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