Class: OData::PropertyMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_odata/property_metadata.rb

Overview

Internally used helper class for storing an entity property's metadata. This class shouldn't be used directly.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (PropertyMetadata) initialize(property_element)

Creates a new instance of the Class Property class



25
26
27
28
29
30
31
32
33
# File 'lib/ruby_odata/property_metadata.rb', line 25

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

Instance Attribute Details

- (Object) association

Applies only to navigation properties; the association corresponding to the property



17
18
19
# File 'lib/ruby_odata/property_metadata.rb', line 17

def association
  @association
end

- (Object) fc_keep_in_content (readonly)

Should the property appear in both the mapped schema path and the properties collection



13
14
15
# File 'lib/ruby_odata/property_metadata.rb', line 13

def fc_keep_in_content
  @fc_keep_in_content
end

- (Object) fc_target_path (readonly)

Feed customization target path



11
12
13
# File 'lib/ruby_odata/property_metadata.rb', line 11

def fc_target_path
  @fc_target_path
end

- (Object) is_key

Applies to the primary key(s)



19
20
21
# File 'lib/ruby_odata/property_metadata.rb', line 19

def is_key
  @is_key
end

- (Object) name (readonly)

The property name



5
6
7
# File 'lib/ruby_odata/property_metadata.rb', line 5

def name
  @name
end

Is the property a navigation property?



15
16
17
# File 'lib/ruby_odata/property_metadata.rb', line 15

def nav_prop
  @nav_prop
end

- (Object) nullable (readonly)

Is the property nullable?



9
10
11
# File 'lib/ruby_odata/property_metadata.rb', line 9

def nullable
  @nullable
end

- (Object) type (readonly)

The property EDM type



7
8
9
# File 'lib/ruby_odata/property_metadata.rb', line 7

def type
  @type
end