Class: NoSE::FieldSetting
Overview
The setting of a field from an Update statement
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Compare settings equal by their field.
-
#hash ⇒ Object
Hash by field and value.
-
#initialize(field, value) ⇒ FieldSetting
constructor
A new instance of FieldSetting.
- #inspect ⇒ Object
Constructor Details
#initialize(field, value) ⇒ FieldSetting
Returns a new instance of FieldSetting.
507 508 509 510 511 512 |
# File 'lib/nose/statements.rb', line 507 def initialize(field, value) @field = field @value = value freeze end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
505 506 507 |
# File 'lib/nose/statements.rb', line 505 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
505 506 507 |
# File 'lib/nose/statements.rb', line 505 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Compare settings equal by their field
519 520 521 |
# File 'lib/nose/statements.rb', line 519 def ==(other) other.field == @field end |
#hash ⇒ Object
Hash by field and value
525 526 527 |
# File 'lib/nose/statements.rb', line 525 def hash Zlib.crc32 [@field.id, @value].to_s end |
#inspect ⇒ Object
514 515 516 |
# File 'lib/nose/statements.rb', line 514 def inspect "#{@field.inspect} = #{value}" end |