Class: ResoTransport::EntityType
- Inherits:
-
Struct
- Object
- Struct
- ResoTransport::EntityType
- Defined in:
- lib/reso_transport/entity_type.rb
Instance Attribute Summary collapse
-
#base_type ⇒ Object
Returns the value of attribute base_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#schema ⇒ Object
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
- #enumerations ⇒ Object
- #navigation_properties ⇒ Object
- #navigation_property_map ⇒ Object
- #parse(record) ⇒ Object
- #parse_value(record) ⇒ Object
- #properties ⇒ Object
- #property_map ⇒ Object
Instance Attribute Details
#base_type ⇒ Object
Returns the value of attribute base_type
2 3 4 |
# File 'lib/reso_transport/entity_type.rb', line 2 def base_type @base_type end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/reso_transport/entity_type.rb', line 2 def name @name end |
#primary_key ⇒ Object
Returns the value of attribute primary_key
2 3 4 |
# File 'lib/reso_transport/entity_type.rb', line 2 def primary_key @primary_key end |
#schema ⇒ Object
Returns the value of attribute schema
2 3 4 |
# File 'lib/reso_transport/entity_type.rb', line 2 def schema @schema end |
Class Method Details
.from_stream(args) ⇒ Object
3 4 5 |
# File 'lib/reso_transport/entity_type.rb', line 3 def self.from_stream(args) new(args['Name'], args['BaseType']) end |
Instance Method Details
#enumerations ⇒ Object
41 42 43 |
# File 'lib/reso_transport/entity_type.rb', line 41 def enumerations @enumerations ||= [] end |
#navigation_properties ⇒ Object
37 38 39 |
# File 'lib/reso_transport/entity_type.rb', line 37 def @navigation_properties ||= [] end |
#navigation_property_map ⇒ Object
33 34 35 |
# File 'lib/reso_transport/entity_type.rb', line 33 def @navigation_property_map ||= .each_with_object({}) { |p, hsh| hsh[p.name] = p; } end |
#parse(record) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/reso_transport/entity_type.rb', line 7 def parse(record) record.each_pair do |k, v| next if v.nil? property = property_map[k] || [k] record[k] = property.parse(v) if property end end |
#parse_value(record) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/reso_transport/entity_type.rb', line 16 def parse_value(record) record.each_pair do |k, v| next if v.nil? property = property_map[k] || [k] record[k] = property.parse(v) if property end end |
#properties ⇒ Object
29 30 31 |
# File 'lib/reso_transport/entity_type.rb', line 29 def properties @properties ||= [] end |
#property_map ⇒ Object
25 26 27 |
# File 'lib/reso_transport/entity_type.rb', line 25 def property_map @property_map ||= properties.each_with_object({}) { |p, hsh| hsh[p.name] = p; } end |