Class: Bits::Package
- Inherits:
-
Object
- Object
- Bits::Package
- Defined in:
- lib/bits/package.rb
Instance Attribute Summary collapse
-
#atom ⇒ Object
readonly
Returns the value of attribute atom.
-
#candidate ⇒ Object
readonly
Returns the value of attribute candidate.
-
#installed ⇒ Object
readonly
Returns the value of attribute installed.
Instance Method Summary collapse
- #candidate_s ⇒ Object
-
#initialize(atom, installed, candidate) ⇒ Package
constructor
A new instance of Package.
- #installed_s ⇒ Object
- #to_s ⇒ Object
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
#atom ⇒ Object (readonly)
Returns the value of attribute atom.
3 4 5 |
# File 'lib/bits/package.rb', line 3 def atom @atom end |
#candidate ⇒ Object (readonly)
Returns the value of attribute candidate.
3 4 5 |
# File 'lib/bits/package.rb', line 3 def candidate @candidate end |
#installed ⇒ Object (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_s ⇒ Object
16 17 18 19 |
# File 'lib/bits/package.rb', line 16 def candidate_s return "(no candidate)" if candidate.nil? candidate end |
#installed_s ⇒ Object
11 12 13 14 |
# File 'lib/bits/package.rb', line 11 def installed_s return "(not installed)" if installed.nil? installed end |
#to_s ⇒ Object
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 |