Class: AttrBitwise::ComparableSymbolsArray

Inherits:
Array
  • Object
show all
Defined in:
lib/attr_bitwise.rb

Overview

Custom class that allow to use shortcut :

my_column == :banana

instead of

my_column == [:banana]

Instance Method Summary collapse

Instance Method Details

#==(other_object) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/attr_bitwise.rb', line 44

def ==(other_object)
  if other_object.is_a?(Symbol)
    self.size == 1 && self.first == other_object
  else
    super(other_object)
  end
end