Class: CqlRuby::Modifier
Instance Attribute Summary collapse
-
#comparison ⇒ Object
Returns the value of attribute comparison.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(new_type, new_comparison = nil, new_value = nil) ⇒ Modifier
constructor
A new instance of Modifier.
- #to_cql ⇒ Object
- #to_xcql(xml = nil, relation_element = "unknown_relation") ⇒ Object
Methods inherited from CqlNode
#check_xml, #getResultSetName, #render_prefixes, #render_sortkeys, #to_solr
Constructor Details
#initialize(new_type, new_comparison = nil, new_value = nil) ⇒ Modifier
Returns a new instance of Modifier.
94 95 96 97 98 99 |
# File 'lib/cql_ruby/cql_nodes.rb', line 94 def initialize( new_type, new_comparison=nil, new_value=nil) super() @type = new_type @comparison = new_comparison @value = new_value end |
Instance Attribute Details
#comparison ⇒ Object
Returns the value of attribute comparison.
92 93 94 |
# File 'lib/cql_ruby/cql_nodes.rb', line 92 def comparison @comparison end |
#type ⇒ Object
Returns the value of attribute type.
92 93 94 |
# File 'lib/cql_ruby/cql_nodes.rb', line 92 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
92 93 94 |
# File 'lib/cql_ruby/cql_nodes.rb', line 92 def value @value end |
Instance Method Details
#to_cql ⇒ Object
101 102 103 104 105 |
# File 'lib/cql_ruby/cql_nodes.rb', line 101 def to_cql res = "#{@type}" res << " #{@comparison} #{@value}" if @value res end |
#to_xcql(xml = nil, relation_element = "unknown_relation") ⇒ Object
107 108 109 110 111 112 113 114 115 116 |
# File 'lib/cql_ruby/cql_nodes.rb', line 107 def to_xcql( xml=nil, relation_element="unknown_relation" ) xml = check_xml( xml ) xml.modifier do xml.type( @type ) if( @value ) xml.tag!( relation_element, @comparison ) if @comparison xml.value( @value ) end end end |