Class: DynamicsCRM::XML::Orders

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamics_crm/xml/orders.rb

Overview

Represents Orders XML element.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrders

Returns a new instance of Orders.



8
9
10
# File 'lib/dynamics_crm/xml/orders.rb', line 8

def initialize
  @order_type = 0
end

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name.



6
7
8
# File 'lib/dynamics_crm/xml/orders.rb', line 6

def attribute_name
  @attribute_name
end

#order_typeObject

Returns the value of attribute order_type.



6
7
8
# File 'lib/dynamics_crm/xml/orders.rb', line 6

def order_type
  @order_type
end

Instance Method Details

#to_hashObject



26
27
28
29
30
31
# File 'lib/dynamics_crm/xml/orders.rb', line 26

def to_hash
  {
    :attribute_name => attribute_name,
    :order_type => order_type
  }
end

#to_xmlObject

Using Entity vs entity causes the error: Value cannot be null. <Order> can be repeated multiple times orderType: 0 (Ascending) or 1 (Descending)



15
16
17
18
19
20
21
22
23
24
# File 'lib/dynamics_crm/xml/orders.rb', line 15

def to_xml
  %Q{
		<a:Orders>
<a:Order>
    <a:attributeName>#{attribute_name}</a:attributeName>
    <a:orderType>#{order_type}</a:orderType>
</a:Order>
		</a:Orders>
  }
end