Class: CqlRuby::NodeSpec
- Inherits:
-
Struct
- Object
- Struct
- CqlRuby::NodeSpec
- Defined in:
- lib/cql_ruby/filter_reader.rb
Constant Summary collapse
- NAME_ANY =
Make this non duplicated.
'*'
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
6 7 8 |
# File 'lib/cql_ruby/filter_reader.rb', line 6 def name @name end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/cql_ruby/filter_reader.rb', line 6 def type @type end |
Class Method Details
.from(raw_value) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cql_ruby/filter_reader.rb', line 16 def from(raw_value) type, name = raw_value.split('=') name ||= NAME_ANY 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
26 27 28 |
# File 'lib/cql_ruby/filter_reader.rb', line 26 def restrict_name? name != NAME_ANY end |