Sha256: 57473a328b829d24b40f923f3834ed3a94ff2ac9ab18242bb45dcc1a879fd1a4

Contents?: true

Size: 1.49 KB

Versions: 3

Compression:

Stored size: 1.49 KB

Contents

module OData
  # Internally used helper class for storing an entity property's metadata.  This class shouldn't be used directly.
  class PropertyMetadata
    # The property name
    attr_reader :name
    # The property EDM type
    attr_reader :type
    # Is the property nullable?
    attr_reader :nullable
    # Feed customization target path
    attr_reader :fc_target_path
    # Should the property appear in both the mapped schema path and the properties collection
    attr_reader :fc_keep_in_content
    # Is the property a navigation property?
    attr_reader :nav_prop
    # Applies only to navigation properties; the association corresponding to the property
    attr_accessor :association

    # Creates a new instance of the Class Property class
    #
    # @param [Nokogiri::XML::Node] property_element from the EDMX

    def initialize(property_element)
      @name =                 property_element['Name']
      @type =                 property_element['Type']
      @nullable =             ((property_element['Nullable'] && property_element['Nullable'] == "true") || property_element.name == 'NavigationProperty') || false
      @fc_target_path =       Helpers.get_namespaced_attribute(property_element, 'FC_TargetPath', 'm')
      keep_in_content =       Helpers.get_namespaced_attribute(property_element, 'FC_KeepInContent', 'm')
      @fc_keep_in_content  =  (keep_in_content) ? (keep_in_content == "true") : nil
      @nav_prop =             property_element.name == 'NavigationProperty'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_odata-0.1.4 lib/ruby_odata/property_metadata.rb
ruby_odata-0.1.3 lib/ruby_odata/property_metadata.rb
ruby_odata-0.1.2 lib/ruby_odata/property_metadata.rb