Class: OData::EntityType
Instance Attribute Summary collapse
-
#abstract ⇒ Object
readonly
Returns the value of attribute abstract.
-
#base_type ⇒ Object
readonly
Returns the value of attribute base_type.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EntityType
constructor
A new instance of EntityType.
- #navigation_properties ⇒ Object
- #navigation_property_by_name(name) ⇒ Object
- #properties ⇒ Object
- #valid_value?(value) ⇒ Boolean
Methods inherited from Type
Constructor Details
#initialize(options = {}) ⇒ EntityType
Returns a new instance of EntityType.
6 7 8 9 10 11 12 13 |
# File 'lib/odata/types/entity_type.rb', line 6 def initialize( = {}) super @abstract = [:abstract] @base_type = [:base_type] @open_type = [:open_type] @has_stream = [:has_stream] @service = [:service] end |
Instance Attribute Details
#abstract ⇒ Object (readonly)
Returns the value of attribute abstract.
4 5 6 |
# File 'lib/odata/types/entity_type.rb', line 4 def abstract @abstract end |
#base_type ⇒ Object (readonly)
Returns the value of attribute base_type.
3 4 5 |
# File 'lib/odata/types/entity_type.rb', line 3 def base_type @base_type end |
Instance Method Details
#navigation_properties ⇒ Object
19 20 21 |
# File 'lib/odata/types/entity_type.rb', line 19 def @navigation_properties ||= @service.(name) end |
#navigation_property_by_name(name) ⇒ Object
23 24 25 26 27 |
# File 'lib/odata/types/entity_type.rb', line 23 def (name) .find do || .name == name end end |
#properties ⇒ Object
15 16 17 |
# File 'lib/odata/types/entity_type.rb', line 15 def properties @properties ||= @service.properties_for_type(name) end |
#valid_value?(value) ⇒ Boolean
29 30 31 |
# File 'lib/odata/types/entity_type.rb', line 29 def valid_value?(value) value.respond_to?(:odata_type) && (name == value.odata_type || name == value.class.superclass.odata_type.name) end |