Class: OData::AbstractSchema::NavigationProperty

Inherits:
SchemaObject
  • Object
show all
Defined in:
lib/o_data/abstract_schema/navigation_property.rb

Instance Attribute Summary collapse

Attributes inherited from SchemaObject

#name, #schema

Instance Method Summary collapse

Methods inherited from SchemaObject

#<=>, #inspect, #plural_name, #qualified_name, #singular_name

Methods included from Comparable

#compare, #sort

Constructor Details

#initialize(schema, entity_type, name, association, options = {}) ⇒ NavigationProperty

Returns a new instance of NavigationProperty.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/o_data/abstract_schema/navigation_property.rb', line 7

def initialize(schema, entity_type, name, association, options = {})
  super(schema, name)

  @entity_type = entity_type
  @association = association

  options.reverse_merge!(:source => true)

  if options[:source]
    @from_end = @association.from_end
    @to_end = @association.to_end
  else
    @to_end = @association.to_end
    @from_end = @association.from_end
  end
end

Instance Attribute Details

#associationObject

Returns the value of attribute association.



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

def association
  @association
end

#entity_typeObject (readonly)

Returns the value of attribute entity_type.



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

def entity_type
  @entity_type
end

#from_endObject

Returns the value of attribute from_end.



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

def from_end
  @from_end
end

#to_endObject

Returns the value of attribute to_end.



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

def to_end
  @to_end
end

Instance Method Details

#find_all(one, key_values = {}) ⇒ Object



28
29
30
# File 'lib/o_data/abstract_schema/navigation_property.rb', line 28

def find_all(one, key_values = {})
  nil
end

#find_one(one, key_value = nil) ⇒ Object



32
33
34
# File 'lib/o_data/abstract_schema/navigation_property.rb', line 32

def find_one(one, key_value = nil)
  nil
end

#return_typeObject



24
25
26
# File 'lib/o_data/abstract_schema/navigation_property.rb', line 24

def return_type
  @to_end.return_type
end