Class: Beats::Command::Base Abstract
- Inherits:
-
Object
- Object
- Beats::Command::Base
- Defined in:
- lib/beats/commands/base.rb
Overview
This class is abstract.
Beats::Command::Base is the base class for all commands. subclass it and add public methods that will become commands. Methods named like the subclass will become the default command for that command group.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(*args) ⇒ Base
Returns a new instance of Base.
15 16 17 |
# File 'lib/beats/commands/base.rb', line 15 def initialize(*args) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
13 14 15 |
# File 'lib/beats/commands/base.rb', line 13 def args @args end |
Class Method Details
.has_command?(command) ⇒ Boolean
19 20 21 22 23 24 25 |
# File 'lib/beats/commands/base.rb', line 19 def self.has_command?(command) if self.instance_methods.first.is_a?(Symbol) self.instance_methods.include?(command.to_sym) else self.instance_methods.include?(command.to_s) end end |