Class: OData::AbstractSchema::Property
- Inherits:
-
SchemaObject
- Object
- SchemaObject
- OData::AbstractSchema::Property
- Defined in:
- lib/o_data/abstract_schema/property.rb
Direct Known Subclasses
Constant Summary collapse
- @@edm_null =
'Edm.Null'.freeze
Instance Attribute Summary collapse
-
#entity_type ⇒ Object
readonly
Returns the value of attribute entity_type.
-
#nullable ⇒ Object
Returns the value of attribute nullable.
-
#return_type ⇒ Object
Returns the value of attribute return_type.
Attributes inherited from SchemaObject
Instance Method Summary collapse
-
#initialize(schema, entity_type, name, return_type = @@edm_null, nullable = true) ⇒ Property
constructor
A new instance of Property.
- #inspect ⇒ Object
- #nullable? ⇒ Boolean
- #qualified_name ⇒ Object
- #value_for(one) ⇒ Object
Methods inherited from SchemaObject
#<=>, #plural_name, #singular_name
Methods included from Comparable
Constructor Details
#initialize(schema, entity_type, name, return_type = @@edm_null, nullable = true) ⇒ Property
Returns a new instance of Property.
10 11 12 13 14 15 16 |
# File 'lib/o_data/abstract_schema/property.rb', line 10 def initialize(schema, entity_type, name, return_type = @@edm_null, nullable = true) super(schema, name) @entity_type = entity_type @return_type = return_type @nullable = nullable end |
Instance Attribute Details
#entity_type ⇒ Object (readonly)
Returns the value of attribute entity_type.
7 8 9 |
# File 'lib/o_data/abstract_schema/property.rb', line 7 def entity_type @entity_type end |
#nullable ⇒ Object
Returns the value of attribute nullable.
8 9 10 |
# File 'lib/o_data/abstract_schema/property.rb', line 8 def nullable @nullable end |
#return_type ⇒ Object
Returns the value of attribute return_type.
8 9 10 |
# File 'lib/o_data/abstract_schema/property.rb', line 8 def return_type @return_type end |
Instance Method Details
#inspect ⇒ Object
30 31 32 |
# File 'lib/o_data/abstract_schema/property.rb', line 30 def inspect "#<< {qualified_name.to_s}(return_type: #{@return_type.to_s}, nullable: #{nullable?}) >>" end |
#nullable? ⇒ Boolean
18 19 20 |
# File 'lib/o_data/abstract_schema/property.rb', line 18 def nullable? !!@nullable end |
#qualified_name ⇒ Object
26 27 28 |
# File 'lib/o_data/abstract_schema/property.rb', line 26 def qualified_name @entity_type.qualified_name.to_s + '#' + self.name end |
#value_for(one) ⇒ Object
22 23 24 |
# File 'lib/o_data/abstract_schema/property.rb', line 22 def value_for(one) nil end |