Class: OsCtld::UserControl::Commands::Base
- Inherits:
-
Commands::Base
- Object
- Commands::Base
- OsCtld::UserControl::Commands::Base
- Defined in:
- lib/osctld/user_control/commands/base.rb
Direct Known Subclasses
CtAutodev, CtOnStart, CtPostMount, CtPostStop, CtPreMount, CtPreStart, CtWrapperStart, VethDown, VethUp
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from Commands::Base
#client, #client_handler, #id, #opts
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user, opts) ⇒ Base
constructor
rubocop:disable Lint/MissingSuper.
- #owns_ct?(ct) ⇒ Boolean protected
Methods inherited from Commands::Base
#base_execute, #call_cmd, #call_cmd!, #error, #error!, #execute, #handled, #indirect?, #manipulate, #manipulation_holder, #ok, #progress, #request_stop, run!
Constructor Details
#initialize(user, opts) ⇒ Base
rubocop:disable Lint/MissingSuper
16 17 18 19 |
# File 'lib/osctld/user_control/commands/base.rb', line 16 def initialize(user, opts) # rubocop:disable Lint/MissingSuper @user = user @opts = opts end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
14 15 16 |
# File 'lib/osctld/user_control/commands/base.rb', line 14 def user @user end |
Class Method Details
.handle(name) ⇒ Object
5 6 7 |
# File 'lib/osctld/user_control/commands/base.rb', line 5 def self.handle(name) UserControl::Command.register(name, self) end |
.run(user, opts = {}) ⇒ Object
9 10 11 12 |
# File 'lib/osctld/user_control/commands/base.rb', line 9 def self.run(user, opts = {}) c = new(user, opts) c.execute end |
Instance Method Details
#owns_ct?(ct) ⇒ Boolean (protected)
23 24 25 |
# File 'lib/osctld/user_control/commands/base.rb', line 23 def owns_ct?(ct) ct.user == user end |