Class: Safrano::FilterBase

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/collection_filter.rb

Direct Known Subclasses

FilterByParse

Constant Summary collapse

EmptyFilter =

re-useable empty filtering (idempotent)

new.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.factory(filterstr) ⇒ Object



14
15
16
# File 'lib/odata/collection_filter.rb', line 14

def self.factory(filterstr)
  filterstr.nil? ? EmptyFilter : FilterByParse.new(filterstr)
end

Instance Method Details

#apply_to_dataset(dtcx) ⇒ Object



18
19
20
# File 'lib/odata/collection_filter.rb', line 18

def apply_to_dataset(dtcx)
  Contract.valid(dtcx)
end

#empty?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/odata/collection_filter.rb', line 27

def empty?
  true
end

#finalize(_jh) ⇒ Object

finalize



23
24
25
# File 'lib/odata/collection_filter.rb', line 23

def finalize(_jh)
  Contract::OK
end

#parse_error?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/odata/collection_filter.rb', line 31

def parse_error?
  false
end