Class: DynamicsCRM::Metadata::EntityQueryExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamics_crm/metadata/entity_query_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EntityQueryExpression

Returns a new instance of EntityQueryExpression.



8
9
10
11
12
# File 'lib/dynamics_crm/metadata/entity_query_expression.rb', line 8

def initialize(options={})
  @criteria = options[:criteria]
  @properties = options[:properties]
  @attribute_query = options[:attribute_query]
end

Instance Attribute Details

#attribute_queryObject

Returns the value of attribute attribute_query.



6
7
8
# File 'lib/dynamics_crm/metadata/entity_query_expression.rb', line 6

def attribute_query
  @attribute_query
end

#criteriaObject

Returns the value of attribute criteria.



6
7
8
# File 'lib/dynamics_crm/metadata/entity_query_expression.rb', line 6

def criteria
  @criteria
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/dynamics_crm/metadata/entity_query_expression.rb', line 6

def properties
  @properties
end

Instance Method Details

#to_xml(options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dynamics_crm/metadata/entity_query_expression.rb', line 14

def to_xml(options={})
  namespace = options[:namespace] ? options[:namespace] : "b"

  xml = ""
  xml << @criteria.to_xml({namespace: namespace}) if @criteria
  xml << @properties.to_xml({namespace: namespace}) if @properties
  xml << @attribute_query.to_xml({namespace: namespace}) if @attribute_query
  xml << "<#{namespace}:ExtensionData i:nil='true' />"
  xml << "<#{namespace}:LabelQuery  i:nil='true' />"
  xml << "<#{namespace}:RelationshipQuery i:nil='true' />"
  xml
end