Class: Gitlab::GrapeOpenapi::Converters::TagConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/grape_openapi/converters/tag_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_class, tag_registry) ⇒ TagConverter

Returns a new instance of TagConverter.



9
10
11
12
# File 'lib/gitlab/grape_openapi/converters/tag_converter.rb', line 9

def initialize(api_class, tag_registry)
  @api_class = api_class
  @tag_registry = tag_registry
end

Instance Attribute Details

#api_classObject (readonly)

Returns the value of attribute api_class.



7
8
9
# File 'lib/gitlab/grape_openapi/converters/tag_converter.rb', line 7

def api_class
  @api_class
end

#tag_registryObject (readonly)

Returns the value of attribute tag_registry.



7
8
9
# File 'lib/gitlab/grape_openapi/converters/tag_converter.rb', line 7

def tag_registry
  @tag_registry
end

Instance Method Details

#convertObject



14
15
16
17
18
19
20
# File 'lib/gitlab/grape_openapi/converters/tag_converter.rb', line 14

def convert
  tags = build_tags(api_class)

  tags.each do |tag|
    tag_registry.register(tag)
  end
end