Class: RuboCop::Isucon::GDA::WhereOperand

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

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: nil, node: nil) ⇒ WhereOperand

Returns a new instance of WhereOperand.

Parameters:

  • value (String) (defaults to: nil)
  • node (GDA::Nodes::Expr) (defaults to: nil)


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

def initialize(value: nil, node: nil)
  @value = value
  @node = node
end

Instance Attribute Details

#nodeGDA::Nodes::Expr

Returns:

  • (GDA::Nodes::Expr)


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

def node
  @node
end

#valueString

Returns:

  • (String)


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

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/rubocop/isucon/gda/where_operand.rb', line 25

def ==(other)
  other.is_a?(WhereOperand) &&
    value == other.value
end