Class: DataSampler::Dependency

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, keys, referring_table_name) ⇒ Dependency

Returns a new instance of Dependency.



8
9
10
11
12
# File 'lib/data_sampler/dependency.rb', line 8

def initialize(table_name, keys, referring_table_name)
  @table_name = table_name
  @keys = keys
  @referring_table_name = referring_table_name
end

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



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

def keys
  @keys
end

#referring_table_nameObject (readonly)

Returns the value of attribute referring_table_name.



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

def referring_table_name
  @referring_table_name
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



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

def table_name
  @table_name
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/data_sampler/dependency.rb', line 14

def eql? other
  table_name == other.table_name and keys == other.keys
end

#to_sObject



18
19
20
# File 'lib/data_sampler/dependency.rb', line 18

def to_s
  "row with keys #{keys} in table `#{table_name}` (referred from `#{referring_table_name}`)"
end