Class: DynamicsCRM::Metadata::AttributeQueryExpression

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(criteria, properties) ⇒ AttributeQueryExpression

Returns a new instance of AttributeQueryExpression.



7
8
9
10
# File 'lib/dynamics_crm/metadata/attribute_query_expression.rb', line 7

def initialize(criteria, properties)
  @criteria = criteria
  @properties = properties
end

Instance Attribute Details

#criteriaObject

Returns the value of attribute criteria.



5
6
7
# File 'lib/dynamics_crm/metadata/attribute_query_expression.rb', line 5

def criteria
  @criteria
end

#propertiesObject

Returns the value of attribute properties.



5
6
7
# File 'lib/dynamics_crm/metadata/attribute_query_expression.rb', line 5

def properties
  @properties
end

Instance Method Details

#to_xml(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/dynamics_crm/metadata/attribute_query_expression.rb', line 12

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

  xml = %Q{<#{namespace}:AttributeQuery>}
  xml << @criteria.to_xml({namespace: namespace}) if @criteria
  xml << @properties.to_xml({namespace: namespace}) if @properties
  xml << %Q{</#{namespace}:AttributeQuery>}

  return xml
end