Class: Gitlab::GrapeOpenapi::TagRegistry
- Inherits:
-
Object
- Object
- Gitlab::GrapeOpenapi::TagRegistry
- Defined in:
- lib/gitlab/grape_openapi/tag_registry.rb
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize ⇒ TagRegistry
constructor
A new instance of TagRegistry.
- #register(tag) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ TagRegistry
Returns a new instance of TagRegistry.
8 9 10 |
# File 'lib/gitlab/grape_openapi/tag_registry.rb', line 8 def initialize @tags = [] end |
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/gitlab/grape_openapi/tag_registry.rb', line 6 def @tags end |
Instance Method Details
#register(tag) ⇒ Object
12 13 14 15 16 |
# File 'lib/gitlab/grape_openapi/tag_registry.rb', line 12 def register(tag) return if tag_exists?(tag) << tag.to_h end |
#to_h ⇒ Object
18 19 20 |
# File 'lib/gitlab/grape_openapi/tag_registry.rb', line 18 def to_h { tags: @tags } end |