Class: RuboCop::Isucon::GDA::JoinOperand

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/isucon/gda/join_operand.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name: nil, column_name: nil, as: nil, node: nil) ⇒ JoinOperand

Returns a new instance of JoinOperand.

Parameters:

  • table_name (String) (defaults to: nil)
  • column_name (String) (defaults to: nil)
  • as (String) (defaults to: nil)
  • node (GDA::Nodes::Expr) (defaults to: nil)


28
29
30
31
32
33
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 28

def initialize(table_name: nil, column_name: nil, as: nil, node: nil)
  @table_name = table_name
  @column_name = column_name
  @as = as
  @node = node
end

Instance Attribute Details

#asString

Returns:

  • (String)


18
19
20
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 18

def as
  @as
end

#column_nameString

Returns:

  • (String)


14
15
16
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 14

def column_name
  @column_name
end

#nodeGDA::Nodes::Expr

Returns:

  • (GDA::Nodes::Expr)


22
23
24
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 22

def node
  @node
end

#table_nameString

Returns:

  • (String)


10
11
12
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 10

def table_name
  @table_name
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/rubocop/isucon/gda/join_operand.rb', line 37

def ==(other)
  other.is_a?(JoinOperand) &&
    table_name == other.table_name &&
    column_name == other.column_name &&
    as == other.as
end