class DynamicsCRM::Metadata::OneToManyRelationship
Represents OneToManyRelationshipMetadata XML
fragment.
Attributes
entity[R]
Public Class Methods
new(entity, xml_fragment)
click to toggle source
Calls superclass method
# File lib/dynamics_crm/metadata/one_to_many_relationship.rb, line 8 def initialize(entity, xml_fragment) super(xml_fragment) @entity = entity end
Public Instance Methods
link_entity_fragment(attributes=[])
click to toggle source
# File lib/dynamics_crm/metadata/one_to_many_relationship.rb, line 13 def link_entity_fragment(attributes=[]) from_object = self.ReferencedEntity from_attribute = self.ReferencedAttribute to_object = self.ReferencingEntity to_attribute = self.ReferencingAttribute attribute_xml = attributes.map {|a| %Q{ <attribute name="#{a}" />} }.join("\n") %Q{ <link-entity name="#{from_object}" from="#{from_attribute}" to="#{to_attribute}" alias="#{from_object}"> #{attribute_xml} </link-entity> } end