Class: Vk::Schema::Definition::Object

Inherits:
Constant show all
Includes:
HasAttributes
Defined in:
lib/vk/schema/definition/object.rb

Instance Attribute Summary

Attributes inherited from Constant

#name

Attributes inherited from Vk::Schema::Definition

#definition, #name, #schema

Instance Method Summary collapse

Methods included from HasAttributes

#attributes, #properties, #required_attribute?

Methods inherited from Constant

#definition_file, #initialize, #namespace, namespace_splitter, #referenced_type_name, #require, #spec_file, #type_name

Methods inherited from Vk::Schema::Definition

#description, #initialize, #to_s

Constructor Details

This class inherits a constructor from Vk::Schema::Definition::Constant

Instance Method Details

#dry_typeString

Returns:

  • (String)

23
24
25
# File 'lib/vk/schema/definition/object.rb', line 23

def dry_type
  "Dry::Types[#{referenced_type_name}]"
end

#parentString

Returns:

  • (String)

11
12
13
14
15
16
17
18
19
20
# File 'lib/vk/schema/definition/object.rb', line 11

def parent
  if definition['type'] == 'object'
    'Vk::Schema::Object'
  else
    reference = definition['allOf'].detect do |definition|
      definition['$ref']
    end
    schema.definition_of(reference['$ref']).referenced_type_name
  end
end