Class: DynamicsCRM::Metadata::AttributeMetadata

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

Overview

AttributeMetadata ManagedPropertyAttributeMetadata IntegerAttributeMetadata BooleanAttributeMetadata DateTimeAttributeMetadata DecimalAttributeMetadata DoubleAttributeMetadata EntityNameAttributeMetadata MoneyAttributeMetadata StringAttributeMetadata LookupAttributeMetadata MemoAttributeMetadata BigIntAttributeMetadata PicklistAttributeMetadata StateAttributeMetadata StatusAttributeMetadata

msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.attributemetadata.aspx

Instance Attribute Summary

Attributes inherited from XmlDocument

#document

Instance Method Summary collapse

Methods inherited from XmlDocument

#initialize, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from DynamicsCRM::Metadata::XmlDocument

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DynamicsCRM::Metadata::XmlDocument

Instance Method Details

#attribute_ofObject



60
61
62
63
64
65
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 60

def attribute_of
  return @attribute_of if @attribute_of

   = "./d:AttributeOf"
  @attribute_of = @document.get_text().to_s
end

#display_nameObject



53
54
55
56
57
58
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 53

def display_name
  return @display_name if @display_name

   = "./d:DisplayName/b:LocalizedLabels/b:LocalizedLabel/b:Label"
  @display_name = @document.get_text().to_s
end

#logical_nameObject



46
47
48
49
50
51
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 46

def logical_name
  return @logical_name if @logical_name

   = "./d:LogicalName"
  @logical_name = @document.get_text().to_s
end

#picklist_optionsObject

Only applicable to PicklistAttributeMetadata



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 25

def picklist_options
  return @picklist_options if @picklist_options

  @picklist_options = {}
   = "./d:OptionSet/d:Options/d:OptionMetadata"
  @document.get_elements().each do |option|
    numeric_value = option.elements["d:Value"].text
    label = option.elements["d:Label/b:UserLocalizedLabel/b:Label"].text
    @picklist_options[numeric_value.to_i] = label
  end

  @picklist_options
end

#required_levelObject



67
68
69
70
71
72
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 67

def required_level
  return @required_level if @required_level

   = "./d:RequiredLevel/b:Value"
  @required_level = @document.get_text().to_s
end

#typeObject



39
40
41
42
43
44
# File 'lib/dynamics_crm/metadata/attribute_metadata.rb', line 39

def type
  return @type if @type

   = "./d:AttributeType"
  @type = @document.get_text().to_s
end