Class: Google::Apis::DiscoveryV1::JsonSchema
- Inherits:
-
Object
- Object
- Google::Apis::DiscoveryV1::JsonSchema
- Defined in:
- lib/google/apis/generator/model.rb
Instance Attribute Summary collapse
-
#base_ref ⇒ Object
Returns the value of attribute base_ref.
-
#discriminant ⇒ Object
Returns the value of attribute discriminant.
-
#discriminant_value ⇒ Object
Returns the value of attribute discriminant_value.
-
#generated_class_name ⇒ Object
Returns the value of attribute generated_class_name.
-
#generated_name ⇒ Object
Returns the value of attribute generated_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#base_ref ⇒ Object
Returns the value of attribute base_ref.
35 36 37 |
# File 'lib/google/apis/generator/model.rb', line 35 def base_ref @base_ref end |
#discriminant ⇒ Object
Returns the value of attribute discriminant.
37 38 39 |
# File 'lib/google/apis/generator/model.rb', line 37 def discriminant @discriminant end |
#discriminant_value ⇒ Object
Returns the value of attribute discriminant_value.
38 39 40 |
# File 'lib/google/apis/generator/model.rb', line 38 def discriminant_value @discriminant_value end |
#generated_class_name ⇒ Object
Returns the value of attribute generated_class_name.
34 35 36 |
# File 'lib/google/apis/generator/model.rb', line 34 def generated_class_name @generated_class_name end |
#generated_name ⇒ Object
Returns the value of attribute generated_name.
33 34 35 |
# File 'lib/google/apis/generator/model.rb', line 33 def generated_name @generated_name end |
#name ⇒ Object
Returns the value of attribute name.
32 33 34 |
# File 'lib/google/apis/generator/model.rb', line 32 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
36 37 38 |
# File 'lib/google/apis/generator/model.rb', line 36 def parent @parent end |
#path ⇒ Object
Returns the value of attribute path.
39 40 41 |
# File 'lib/google/apis/generator/model.rb', line 39 def path @path end |
Instance Method Details
#generated_type ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/google/apis/generator/model.rb', line 49 def generated_type case type when 'string', 'boolean', 'number', 'integer', 'any' return 'DateTime' if format == 'date-time' return 'Date' if format == 'date' return 'Fixnum' if format == 'int64' return 'Fixnum' if format == 'uint64' return TYPE_MAP[type] when 'array' if items == self return sprintf('Array<%s>', qualified_name) end return sprintf('Array<%s>', items.generated_type) when 'hash' if additional_properties == self return sprintf('Hash<String,%s>', qualified_name) end return sprintf('Hash<String,%s>', additional_properties.generated_type) when 'object' return qualified_name end end |
#properties ⇒ Object
41 42 43 |
# File 'lib/google/apis/generator/model.rb', line 41 def properties Hash[(@properties || {}).sort] end |
#qualified_name ⇒ Object
45 46 47 |
# File 'lib/google/apis/generator/model.rb', line 45 def qualified_name parent.qualified_name + '::' + generated_class_name end |