Class: OasCore::Spec::License

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_core/spec/license.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Specable

#as_json, #to_spec

Constructor Details

#initialize(**kwargs) ⇒ License

Returns a new instance of License.



10
11
12
13
# File 'lib/oas_core/spec/license.rb', line 10

def initialize(**kwargs)
  @name = kwargs[:name] || 'GPL 3.0'
  @url = kwargs[:url] || 'https://www.gnu.org/licenses/gpl-3.0.html#license-text'
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/oas_core/spec/license.rb', line 8

def name
  @name
end

#urlObject

Returns the value of attribute url.



8
9
10
# File 'lib/oas_core/spec/license.rb', line 8

def url
  @url
end

Instance Method Details

#oas_fieldsObject



15
16
17
# File 'lib/oas_core/spec/license.rb', line 15

def oas_fields
  %i[name url]
end