Class: LicenseAcceptance::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/license_acceptance/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, pretty_name, filename, mixlib_name, license_required_version) ⇒ Product

Returns a new instance of Product.


6
7
8
9
10
11
12
13
# File 'lib/license_acceptance/product.rb', line 6

def initialize(id, pretty_name, filename, mixlib_name, license_required_version)
  # id is the internal representation of this product as license-acceptance knows it
  @id = id
  @pretty_name = pretty_name
  @filename = filename
  @mixlib_name = mixlib_name
  @license_required_version = license_required_version
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename


4
5
6
# File 'lib/license_acceptance/product.rb', line 4

def filename
  @filename
end

#idObject (readonly)

Returns the value of attribute id


4
5
6
# File 'lib/license_acceptance/product.rb', line 4

def id
  @id
end

#license_required_versionObject (readonly)

Returns the value of attribute license_required_version


4
5
6
# File 'lib/license_acceptance/product.rb', line 4

def license_required_version
  @license_required_version
end

#mixlib_nameObject (readonly)

Returns the value of attribute mixlib_name


4
5
6
# File 'lib/license_acceptance/product.rb', line 4

def mixlib_name
  @mixlib_name
end

#pretty_nameObject (readonly)

Returns the value of attribute pretty_name


4
5
6
# File 'lib/license_acceptance/product.rb', line 4

def pretty_name
  @pretty_name
end

Instance Method Details

#==(other) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/license_acceptance/product.rb', line 15

def ==(other)
  return false if other.class != Product
  if other.id == id &&
     other.pretty_name == pretty_name &&
     other.filename == filename &&
     other.mixlib_name == mixlib_name
     other.license_required_version == license_required_version
     return true
  end
  return false
end