Class: CqlRuby::FilterReader::NodeSpec

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name



38
39
40
# File 'lib/cql_ruby/filter_reader.rb', line 38

def name
  @name
end

#typeObject

Returns the value of attribute type



38
39
40
# File 'lib/cql_ruby/filter_reader.rb', line 38

def type
  @type
end

Class Method Details

.from(raw_value) ⇒ Object



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

def from(raw_value)
  type, name = raw_value.split('=')
  name ||= CqlRuby::MATCH_ANYTHING

  raise "Type '#{type}' is not recognized. See 'cql_ruby --help' for allowed types." unless Parser::Meta::NODE_TYPES.member?(type.to_sym)

  new(type, name)
end

Instance Method Details

#restrict_name?Boolean



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

def restrict_name?
  name != CqlRuby::MATCH_ANYTHING
end