Class: PackagePresenter
- Inherits:
-
Object
- Object
- PackagePresenter
- Defined in:
- lib/cmd/inspect.rb
Instance Attribute Summary collapse
-
#pkg ⇒ Object
Returns the value of attribute pkg.
Instance Method Summary collapse
- #flavors ⇒ Object
- #flavors_as_string ⇒ Object
- #homepage ⇒ Object
-
#initialize(obj) ⇒ PackagePresenter
constructor
A new instance of PackagePresenter.
- #is_active? ⇒ Boolean
- #manifest ⇒ Object
- #name ⇒ Object
- #upgradeable? ⇒ Boolean
- #version ⇒ Object
Constructor Details
#initialize(obj) ⇒ PackagePresenter
Returns a new instance of PackagePresenter.
28 29 30 |
# File 'lib/cmd/inspect.rb', line 28 def initialize obj @pkg = obj end |
Instance Attribute Details
#pkg ⇒ Object
Returns the value of attribute pkg.
26 27 28 |
# File 'lib/cmd/inspect.rb', line 26 def pkg @pkg end |
Instance Method Details
#flavors ⇒ Object
40 41 42 |
# File 'lib/cmd/inspect.rb', line 40 def flavors flavors_as_string.empty? ? "nil" : flavors_as_string end |
#flavors_as_string ⇒ Object
44 45 46 47 48 |
# File 'lib/cmd/inspect.rb', line 44 def flavors_as_string if @pkg.facts.flavors return @pkg.facts.flavors.join ", " end end |
#homepage ⇒ Object
54 55 56 |
# File 'lib/cmd/inspect.rb', line 54 def homepage @pkg.facts.homepage or 'n/a' end |
#is_active? ⇒ Boolean
36 37 38 |
# File 'lib/cmd/inspect.rb', line 36 def is_active? pkg.is_active? end |
#manifest ⇒ Object
62 63 64 |
# File 'lib/cmd/inspect.rb', line 62 def manifest @pkg.facts.facts_file end |
#name ⇒ Object
32 33 34 |
# File 'lib/cmd/inspect.rb', line 32 def name @pkg.name end |
#upgradeable? ⇒ Boolean
58 59 60 |
# File 'lib/cmd/inspect.rb', line 58 def upgradeable? @pkg.is_git_repo? end |
#version ⇒ Object
50 51 52 |
# File 'lib/cmd/inspect.rb', line 50 def version @pkg.facts.version or 'n/a' end |