Class: CF::UAA::ScimFilter
- Inherits:
-
Object
- Object
- CF::UAA::ScimFilter
- Defined in:
- lib/uaa/stub/scim.rb
Instance Method Summary collapse
-
#initialize(filter_string) ⇒ ScimFilter
constructor
A new instance of ScimFilter.
- #match?(entry) ⇒ Boolean
Constructor Details
#initialize(filter_string) ⇒ ScimFilter
Returns a new instance of ScimFilter.
474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/uaa/stub/scim.rb', line 474 def initialize(filter_string) if filter_string.nil? @filter = true else @input = StringScanner.new(filter_string) @filter = eat_phrase raise BadFilter unless @input.eos? end self rescue BadFilter => b raise BadFilter, "invalid filter expression at offset #{@input.pos}: #{@input.string}" end |
Instance Method Details
#match?(entry) ⇒ Boolean
487 488 489 |
# File 'lib/uaa/stub/scim.rb', line 487 def match?(entry) @filter == true || eval(entry, @filter) end |