Class: Daedal::Attributes::QueryArray

Inherits:
Array
  • Object
show all
Defined in:
lib/daedal/attributes/query_array.rb

Instance Method Summary collapse

Instance Method Details

#<<(q) ⇒ Object

override the << method so that you throw an error if you don’t try to append a query



9
10
11
12
13
14
15
# File 'lib/daedal/attributes/query_array.rb', line 9

def <<(q)
  if q.is_a? Daedal::Queries::Query
    super q
  else
    raise Virtus::CoercionError.new(q, 'Daedal::Queries::Query')
  end
end