Class: OData::ComplexType

Inherits:
Type
  • Object
show all
Defined in:
lib/odata/types/complex_type.rb

Instance Attribute Summary collapse

Attributes inherited from Type

#name

Instance Method Summary collapse

Methods inherited from Type

#coerce, #collection?

Constructor Details

#initialize(options = {}) ⇒ ComplexType


5
6
7
8
9
# File 'lib/odata/types/complex_type.rb', line 5

def initialize(options = {})
  super
  @base_type = options[:base_type]
  @service   = options[:service]
end

Instance Attribute Details

#base_typeObject (readonly)

Returns the value of attribute base_type


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

def base_type
  @base_type
end

Instance Method Details

#propertiesObject


11
12
13
# File 'lib/odata/types/complex_type.rb', line 11

def properties
  @properties ||= @service.properties_for_type(name)
end

#valid_value?(value) ⇒ Boolean


15
16
17
# File 'lib/odata/types/complex_type.rb', line 15

def valid_value?(value)
  value.respond_to?(:odata_type) && self.name == value.odata_type
end