Method: Frodo::Schema#navigation_properties_for_entity

Defined in:
lib/frodo/schema.rb

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get the list of navigation properties and their various options for the supplied Entity name.

Parameters:

  • entity_name (to_s)

Returns:

  • (Hash)


105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/frodo/schema.rb', line 105

def navigation_properties_for_entity(entity_name)
  type_definition = get_type_definition_for_entity_name(entity_name)

  parent_properties = recurse_on_parent_type(type_definition)

  properties_to_return = type_definition.xpath('./NavigationProperty').map do |nav_property_def|
    [
      nav_property_def.attributes['Name'].value,
      ::Frodo::NavigationProperty.build(nav_property_def)
    ]
  end.to_h
  parent_properties.merge!(properties_to_return)
end