Class: CmisServer::Query::WhereClause
- Inherits:
-
Object
- Object
- CmisServer::Query::WhereClause
- Defined in:
- lib/cmis_server/query/simple_parser.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
Instance Method Summary collapse
-
#initialize(conditions) ⇒ WhereClause
constructor
A new instance of WhereClause.
-
#to_h ⇒ Object
Convert to hash format for the connector.
Constructor Details
#initialize(conditions) ⇒ WhereClause
Returns a new instance of WhereClause.
226 227 228 |
# File 'lib/cmis_server/query/simple_parser.rb', line 226 def initialize(conditions) @conditions = conditions end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
224 225 226 |
# File 'lib/cmis_server/query/simple_parser.rb', line 224 def conditions @conditions end |
Instance Method Details
#to_h ⇒ Object
Convert to hash format for the connector
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/cmis_server/query/simple_parser.rb', line 231 def to_h # For now, convert simple conditions to a hash result = {} @conditions.each do |cond| next unless cond.is_a?(WhereCondition) # Map CMIS properties to search parameters property = cond.left.sub(/^\w+\./, '') # Remove alias if present case property when 'cmis:name' result['name'] = cond.right when 'cmis:objectTypeId' result['type_id'] = cond.right when 'cmis:parentId' result['parent_id'] = cond.right else result[property] = cond.right end end result end |