Class: Gitlab::GrapeOpenapi::Models::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/grape_openapi/models/info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Info

Returns a new instance of Info.



9
10
11
12
13
14
15
# File 'lib/gitlab/grape_openapi/models/info.rb', line 9

def initialize(**options)
  @title = options[:title]
  @description = options[:description]
  @terms_of_service = options[:terms_of_service]
  @version = options[:version]
  @license = options[:license]
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/gitlab/grape_openapi/models/info.rb', line 7

def description
  @description
end

#licenseObject

Returns the value of attribute license.



7
8
9
# File 'lib/gitlab/grape_openapi/models/info.rb', line 7

def license
  @license
end

#terms_of_serviceObject

Returns the value of attribute terms_of_service.



7
8
9
# File 'lib/gitlab/grape_openapi/models/info.rb', line 7

def terms_of_service
  @terms_of_service
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/gitlab/grape_openapi/models/info.rb', line 7

def title
  @title
end

#versionObject

Returns the value of attribute version.



7
8
9
# File 'lib/gitlab/grape_openapi/models/info.rb', line 7

def version
  @version
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
24
25
# File 'lib/gitlab/grape_openapi/models/info.rb', line 17

def to_h
  {
    title: title,
    description: description,
    termsOfService: terms_of_service,
    version: version,
    license: license
  }.compact
end