Class: CqlRuby::FilterReader

Inherits:
Object
  • Object
show all
Defined in:
lib/cql_ruby/filter_reader.rb

Overview

Reads and provides filters.

Accepted filters and syntax:

Type:

type:(,[name])* example: type:def,send

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_filters) ⇒ FilterReader

Returns a new instance of FilterReader.



46
47
48
49
50
51
52
53
# File 'lib/cql_ruby/filter_reader.rb', line 46

def initialize(raw_filters)
  super()

  @allowed_types = []
  @nest_under = []

  parse_raw_filters(raw_filters)
end

Instance Attribute Details

#allowed_typesObject (readonly)

Returns the value of attribute allowed_types.



42
43
44
# File 'lib/cql_ruby/filter_reader.rb', line 42

def allowed_types
  @allowed_types
end

#nest_underObject (readonly)

Returns the value of attribute nest_under.



44
45
46
# File 'lib/cql_ruby/filter_reader.rb', line 44

def nest_under
  @nest_under
end

Instance Method Details

#restrict_nesting?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/cql_ruby/filter_reader.rb', line 59

def restrict_nesting?
  !@nest_under.empty?
end

#restrict_types?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/cql_ruby/filter_reader.rb', line 55

def restrict_types?
  !@allowed_types.empty?
end