Class: Cejo::Distro::Need
- Inherits:
-
Object
- Object
- Cejo::Distro::Need
- Defined in:
- lib/cejo/distro/need.rb
Overview
Base
Constant Summary collapse
- ADMIN =
i[install remove purge update upgrade clean autoremove].freeze
- ARGUMENTS =
i[install remove purge dependencies].freeze
- WHATEVER =
i[autoremove].freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
-
#admin? ⇒ Boolean
Action need to be run with administration level.
-
#arguments? ⇒ Boolean
Action need any argument.
-
#initialize(action) ⇒ Need
constructor
A new instance of Need.
- #whatever? ⇒ Boolean
Constructor Details
#initialize(action) ⇒ Need
Returns a new instance of Need.
13 14 15 |
# File 'lib/cejo/distro/need.rb', line 13 def initialize(action) @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/cejo/distro/need.rb', line 7 def action @action end |
Instance Method Details
#admin? ⇒ Boolean
Action need to be run with administration level
18 19 20 |
# File 'lib/cejo/distro/need.rb', line 18 def admin? true if ADMIN.include? action end |
#arguments? ⇒ Boolean
Action need any argument
23 24 25 |
# File 'lib/cejo/distro/need.rb', line 23 def arguments? true if ARGUMENTS.include? action end |
#whatever? ⇒ Boolean
27 28 29 |
# File 'lib/cejo/distro/need.rb', line 27 def whatever? true if WHATEVER.include? action end |