Class: Arel::Nodes::DeltaAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/delta_attributes3_2/update_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arel_node, new_value = nil, old_value = nil) ⇒ DeltaAttribute

Returns a new instance of DeltaAttribute.



8
9
10
11
12
# File 'lib/delta_attributes3_2/update_statement.rb', line 8

def initialize(arel_node, new_value = nil, old_value = nil)
  @arel_node = arel_node
  @new_value = new_value
  @old_value = old_value
end

Instance Attribute Details

#arel_nodeObject

Returns the value of attribute arel_node.



6
7
8
# File 'lib/delta_attributes3_2/update_statement.rb', line 6

def arel_node
  @arel_node
end

#new_valueObject

Returns the value of attribute new_value.



6
7
8
# File 'lib/delta_attributes3_2/update_statement.rb', line 6

def new_value
  @new_value
end

#old_valueObject

Returns the value of attribute old_value.



6
7
8
# File 'lib/delta_attributes3_2/update_statement.rb', line 6

def old_value
  @old_value
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/delta_attributes3_2/update_statement.rb', line 14

def valid?
  @arel_node && !new_value.nil? && !old_value.nil?
end