Class: Vk::Schema::Definition
- Inherits:
-
Object
- Object
- Vk::Schema::Definition
show all
- Defined in:
- lib/vk/schema/definition.rb,
lib/vk/schema/definition/type.rb,
lib/vk/schema/definition/error.rb,
lib/vk/schema/definition/method.rb,
lib/vk/schema/definition/object.rb,
lib/vk/schema/definition/constant.rb,
lib/vk/schema/definition/response.rb,
lib/vk/schema/definition/attribute.rb,
lib/vk/schema/definition/has_attributes.rb
Defined Under Namespace
Modules: HasAttributes
Classes: Attribute, Constant, Error, Method, Object, Response, Type
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name, definition, schema) ⇒ Definition
Returns a new instance of Definition.
20
21
22
23
24
|
# File 'lib/vk/schema/definition.rb', line 20
def initialize(name, definition, schema)
@name = name
@definition = definition
@schema = schema
end
|
Instance Attribute Details
#definition ⇒ Hash
30
31
32
|
# File 'lib/vk/schema/definition.rb', line 30
def definition
@definition
end
|
#name ⇒ String
27
28
29
|
# File 'lib/vk/schema/definition.rb', line 27
def name
@name
end
|
33
34
35
|
# File 'lib/vk/schema/definition.rb', line 33
def schema
@schema
end
|
Instance Method Details
#description ⇒ String
36
37
38
39
|
# File 'lib/vk/schema/definition.rb', line 36
def description
definition['description']&.gsub(/([{}])/, '\$1')&.strip ||
'@see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json'
end
|
#to_s ⇒ String
42
43
44
|
# File 'lib/vk/schema/definition.rb', line 42
def to_s
name
end
|