Class: Apiwork::API::Info::License

Inherits:
Object
  • Object
show all
Defined in:
lib/apiwork/api/info/license.rb

Overview

License information block.

Used within the ‘license` block in Apiwork::API::Info.

Instance Method Summary collapse

Constructor Details

#initializeLicense

Returns a new instance of License.



11
12
13
14
# File 'lib/apiwork/api/info/license.rb', line 11

def initialize
  @name = nil
  @url = nil
end

Instance Method Details

#name(value = nil) ⇒ String?

The license name.

Examples:

name 'MIT'
license.name # => "MIT"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The name.

Returns:

  • (String, nil)


26
27
28
29
30
# File 'lib/apiwork/api/info/license.rb', line 26

def name(value = nil)
  return @name if value.nil?

  @name = value
end

#url(value = nil) ⇒ String?

The license URL.

Examples:

url 'https://opensource.org/licenses/MIT'
license.url # => "https://opensource.org/licenses/MIT"

Parameters:

  • value (String, nil) (defaults to: nil)

    (nil) The URL.

Returns:

  • (String, nil)


42
43
44
45
46
# File 'lib/apiwork/api/info/license.rb', line 42

def url(value = nil)
  return @url if value.nil?

  @url = value
end