Class: Bits::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/bits/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(atom, installed, candidate) ⇒ Package

Returns a new instance of Package.



5
6
7
8
9
# File 'lib/bits/package.rb', line 5

def initialize(atom, installed, candidate)
  @atom = atom
  @installed = installed
  @candidate = candidate
end

Instance Attribute Details

#atomObject (readonly)

Returns the value of attribute atom.



3
4
5
# File 'lib/bits/package.rb', line 3

def atom
  @atom
end

#candidateObject (readonly)

Returns the value of attribute candidate.



3
4
5
# File 'lib/bits/package.rb', line 3

def candidate
  @candidate
end

#installedObject (readonly)

Returns the value of attribute installed.



3
4
5
# File 'lib/bits/package.rb', line 3

def installed
  @installed
end

Instance Method Details

#candidate_sObject



16
17
18
19
# File 'lib/bits/package.rb', line 16

def candidate_s
  return "(no candidate)" if candidate.nil?
  candidate
end

#installed_sObject



11
12
13
14
# File 'lib/bits/package.rb', line 11

def installed_s
  return "(not installed)" if installed.nil?
  installed
end

#to_sObject



21
22
23
24
25
# File 'lib/bits/package.rb', line 21

def to_s
  installed_s = @installed || "(not installed)"
  candidate_s = @candidate || "(no candidate)"
  "<Package atom='#{@atom}' installed='#{installed_s}' candidate='#{candidate_s}'>"
end