Class: Katello::SimplePackage

Inherits:
Object
  • Object
show all
Defined in:
app/services/katello/simple_package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ SimplePackage

Returns a new instance of SimplePackage.



5
6
7
# File 'app/services/katello/simple_package.rb', line 5

def initialize(params = {})
  params.each_pair { |k, v| instance_variable_set("@#{k}", v) unless v.nil? }
end

Instance Attribute Details

#archObject

Returns the value of attribute arch.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def arch
  @arch
end

#epochObject

Returns the value of attribute epoch.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def epoch
  @epoch
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def name
  @name
end

#persistenceObject

Returns the value of attribute persistence.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def persistence
  @persistence
end

#releaseObject

Returns the value of attribute release.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def release
  @release
end

#vendorObject

Returns the value of attribute vendor.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def vendor
  @vendor
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'app/services/katello/simple_package.rb', line 3

def version
  @version
end

Instance Method Details

#nvraObject



9
10
11
# File 'app/services/katello/simple_package.rb', line 9

def nvra
  "#{@name}-#{@version}-#{@release}.#{@arch}"
end

#nvreaObject



13
14
15
16
17
18
19
# File 'app/services/katello/simple_package.rb', line 13

def nvrea
  if epoch.nil? || epoch.to_s == "0"
    nvra
  else
    "#{@name}-#{@epoch}:#{@version}-#{@release}.#{@arch}"
  end
end