Class: CqlRuby::CqlPrefixNode
- Defined in:
- lib/cql_ruby/cql_nodes.rb
Instance Attribute Summary collapse
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#subtree ⇒ Object
Returns the value of attribute subtree.
Instance Method Summary collapse
-
#initialize(name = nil, identifier = nil, new_subtree = nil) ⇒ CqlPrefixNode
constructor
A new instance of CqlPrefixNode.
- #to_cql ⇒ Object
- #to_xcql(xml = nil, prefixes = nil, sortkeys = nil) ⇒ Object
Methods inherited from CqlNode
#check_xml, #getResultSetName, #render_prefixes, #render_sortkeys, #to_solr
Constructor Details
#initialize(name = nil, identifier = nil, new_subtree = nil) ⇒ CqlPrefixNode
Returns a new instance of CqlPrefixNode.
67 68 69 70 71 |
# File 'lib/cql_ruby/cql_nodes.rb', line 67 def initialize( name=nil, identifier=nil, new_subtree=nil ) super() @prefix = CqlPrefix.new( name, identifier ) @subtree = new_subtree end |
Instance Attribute Details
#prefix ⇒ Object
Returns the value of attribute prefix.
66 67 68 |
# File 'lib/cql_ruby/cql_nodes.rb', line 66 def prefix @prefix end |
#subtree ⇒ Object
Returns the value of attribute subtree.
66 67 68 |
# File 'lib/cql_ruby/cql_nodes.rb', line 66 def subtree @subtree end |
Instance Method Details
#to_cql ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/cql_ruby/cql_nodes.rb', line 73 def to_cql if @prefix.name ">#{@prefix.name}=\"#{@prefix.identifier}\" (#{@subtree.to_cql})" else ">\"#{@prefix.identifier}\" (#{@subtree.to_cql})" end end |
#to_xcql(xml = nil, prefixes = nil, sortkeys = nil) ⇒ Object
81 82 83 84 85 86 87 88 |
# File 'lib/cql_ruby/cql_nodes.rb', line 81 def to_xcql( xml=nil, prefixes=nil, sortkeys=nil ) xml = check_xml( xml ) tmp = [] tmp = prefixes.dup if prefixes tmp << @prefix @subtree.to_xcql( xml, tmp, sortkeys ) end |