Method: Frodo::Schema#properties_for_entity

Defined in:
lib/frodo/schema.rb

#properties_for_entity(entity_name) ⇒ Hash

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 properties and their various options for the supplied Entity name.

Parameters:

  • entity_name (to_s)

Returns:

  • (Hash)


158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/frodo/schema.rb', line 158

def properties_for_entity(entity_name)
  type_definition = get_type_definition_for_entity_name(entity_name)
  properties_to_return = {}

  parent_properties = recurse_on_parent_type(type_definition)

  type_definition.xpath('./Property').each do |property_xml|
    property_name, property = process_property_from_xml(property_xml)
    properties_to_return[property_name] = property
  end
  parent_properties.merge!(properties_to_return)
end