Class: OData::NavigationProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/navigation_property.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NavigationProperty


9
10
11
12
13
14
15
# File 'lib/odata/navigation_property.rb', line 9

def initialize(options = {})
  @name           = options[:name]
  @type           = options[:type]
  @nullable       = options[:nullable].nil? ? true : false
  @contain_target = options[:contain_target] || false
  @partner        = options[:partner]
end

Instance Attribute Details

#contain_targetObject (readonly)

Returns the value of attribute contain_target


6
7
8
# File 'lib/odata/navigation_property.rb', line 6

def contain_target
  @contain_target
end

#nameObject (readonly)

Returns the value of attribute name


3
4
5
# File 'lib/odata/navigation_property.rb', line 3

def name
  @name
end

#nullableObject (readonly)

Returns the value of attribute nullable


5
6
7
# File 'lib/odata/navigation_property.rb', line 5

def nullable
  @nullable
end

#partnerObject (readonly)

Returns the value of attribute partner


7
8
9
# File 'lib/odata/navigation_property.rb', line 7

def partner
  @partner
end

#typeObject (readonly)

Returns the value of attribute type


4
5
6
# File 'lib/odata/navigation_property.rb', line 4

def type
  @type
end

Instance Method Details

#collection?Boolean


17
18
19
# File 'lib/odata/navigation_property.rb', line 17

def collection?
  OData::CollectionType === type
end

#collection_type_match?(value) ⇒ Boolean


25
26
27
28
# File 'lib/odata/navigation_property.rb', line 25

def collection_type_match?(value)
  collection = type
  collection.valid_value?(value)
end

#type_match?(value) ⇒ Boolean


21
22
23
# File 'lib/odata/navigation_property.rb', line 21

def type_match?(value)
  type.valid_value?(value)
end