Class: DynamicsCRM::Metadata::OneToManyRelationship
- Inherits:
-
XmlDocument
- Object
- XmlDocument
- DynamicsCRM::Metadata::OneToManyRelationship
- Defined in:
- lib/dynamics_crm/metadata/one_to_many_relationship.rb
Overview
Represents OneToManyRelationshipMetadata XML fragment.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
Attributes inherited from XmlDocument
Instance Method Summary collapse
-
#initialize(entity, xml_fragment) ⇒ OneToManyRelationship
constructor
A new instance of OneToManyRelationship.
- #link_entity_fragment(attributes = []) ⇒ Object
Methods inherited from XmlDocument
#method_missing, #respond_to_missing?
Constructor Details
#initialize(entity, xml_fragment) ⇒ OneToManyRelationship
Returns a new instance of OneToManyRelationship.
8 9 10 11 |
# File 'lib/dynamics_crm/metadata/one_to_many_relationship.rb', line 8 def initialize(entity, xml_fragment) super(xml_fragment) @entity = entity end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DynamicsCRM::Metadata::XmlDocument
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
6 7 8 |
# File 'lib/dynamics_crm/metadata/one_to_many_relationship.rb', line 6 def entity @entity end |
Instance Method Details
#link_entity_fragment(attributes = []) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# 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 |