Class: Inventory::License

Inherits:
Object
  • Object
show all
Defined in:
lib/inventory-1.0/license.rb

Overview

A license used by the project stored in the list of Licenses in the inventory.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(abbreviation, name, url) ⇒ License

Sets up a new license NAME, often referred to via ABBREVIATION, than can be found at URL.

Parameters:

  • abbreviation (String)
  • name (String)
  • url (String)


12
13
14
# File 'lib/inventory-1.0/license.rb', line 12

def initialize(abbreviation, name, url)
  @abbreviation, @name, @url = abbreviation, name, url
end

Instance Attribute Details

#abbreviationString (readonly)

Returns The abbreviation of the #name of the license.

Returns:

  • (String)

    The abbreviation of the #name of the license



22
23
24
# File 'lib/inventory-1.0/license.rb', line 22

def abbreviation
  @abbreviation
end

#nameString (readonly)

Returns The name of the license.

Returns:

  • (String)

    The name of the license



25
26
27
# File 'lib/inventory-1.0/license.rb', line 25

def name
  @name
end

#urlString (readonly)

Returns The URL at which the license can be found.

Returns:

  • (String)

    The URL at which the license can be found



28
29
30
# File 'lib/inventory-1.0/license.rb', line 28

def url
  @url
end

Instance Method Details

#to_sString

Returns The #abbreviation of the license.

Returns:



17
18
19
# File 'lib/inventory-1.0/license.rb', line 17

def to_s
  abbreviation.dup
end