Class: OasRails::Spec::License

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_rails/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.



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

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.



6
7
8
# File 'lib/oas_rails/spec/license.rb', line 6

def name
  @name
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/oas_rails/spec/license.rb', line 6

def url
  @url
end

Instance Method Details

#oas_fieldsObject



13
14
15
# File 'lib/oas_rails/spec/license.rb', line 13

def oas_fields
  [:name, :url]
end