class DynamicsCRM::FetchXml::Entity

Attributes

attributes[R]
conditions[R]
logical_name[R]
order_desc[R]
order_field[R]

Public Class Methods

new(logical_name, options={}) click to toggle source
# File lib/dynamics_crm/fetch_xml/entity.rb, line 8
def initialize(logical_name, options={})
  # options used by LinkEntity subclass
  @logical_name = logical_name
  @attributes = []
  @link_entities = []
  @conditions = []
end

Public Instance Methods

add_attributes(field_names=nil) click to toggle source
# File lib/dynamics_crm/fetch_xml/entity.rb, line 16
def add_attributes(field_names=nil)
  @attributes = field_names
  self
end
add_condition(attribute, operator, value) click to toggle source
# File lib/dynamics_crm/fetch_xml/entity.rb, line 33
def add_condition(attribute, operator, value)
  @conditions << {
    attribute: attribute,
    operator: operator,
    value: value
  }
  self
end
has_conditions?() click to toggle source
# File lib/dynamics_crm/fetch_xml/entity.rb, line 42
def has_conditions?
  @conditions.any?
end
order(field_name, descending=false) click to toggle source

<order attribute=“productid” descending=“false” />

# File lib/dynamics_crm/fetch_xml/entity.rb, line 22
def order(field_name, descending=false)
  @order_field = field_name
  @order_desc = descending
  self
end