Class: OdataDuty::ComplexType
- Inherits:
-
Object
- Object
- OdataDuty::ComplexType
- Defined in:
- lib/odata_duty/complex_type.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Metadata
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#od_context ⇒ Object
readonly
Returns the value of attribute od_context.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object, context) ⇒ ComplexType
constructor
A new instance of ComplexType.
Constructor Details
#initialize(object, context) ⇒ ComplexType
Returns a new instance of ComplexType.
65 66 67 68 |
# File 'lib/odata_duty/complex_type.rb', line 65 def initialize(object, context) @object = object @od_context = context end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
62 63 64 |
# File 'lib/odata_duty/complex_type.rb', line 62 def object @object end |
#od_context ⇒ Object (readonly)
Returns the value of attribute od_context.
63 64 65 |
# File 'lib/odata_duty/complex_type.rb', line 63 def od_context @od_context end |
Class Method Details
.__metadata ⇒ Object
58 59 60 |
# File 'lib/odata_duty/complex_type.rb', line 58 def self. Metadata.new(self) end |
.properties ⇒ Object
5 6 7 |
# File 'lib/odata_duty/complex_type.rb', line 5 def self.properties @properties ||= [] end |
.property(name, *args, **kwargs) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/odata_duty/complex_type.rb', line 9 def self.property(name, *args, **kwargs) if properties.any? { |p| p.name == name.to_sym } raise PropertyAlreadyDefinedError, "#{name} is already defined" end Property.new(name, *args, **kwargs).tap do |property| properties << property end end |