Class: Ellipses::Client::Command
- Inherits:
-
Object
- Object
- Ellipses::Client::Command
- Extended by:
- DSL
- Defined in:
- lib/ellipses/client/command.rb
Direct Known Subclasses
Ellipses::Client::Commands::Include, Ellipses::Client::Commands::Reject, Ellipses::Client::Commands::Select, Ellipses::Client::Commands::Substitute, Ellipses::Client::Commands::Translate
Defined Under Namespace
Modules: DSL, Mixins Classes: Proto
Constant Summary collapse
- Error =
Class.new Error
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #call(input, **kwargs) ⇒ Object
- #error(*args) ⇒ Object
-
#initialize(argv, server) ⇒ Command
constructor
A new instance of Command.
- #setup ⇒ Object
- #to_s ⇒ Object
Methods included from DSL
Constructor Details
#initialize(argv, server) ⇒ Command
Returns a new instance of Command.
42 43 44 45 46 47 48 |
# File 'lib/ellipses/client/command.rb', line 42 def initialize(argv, server) @argv = argv @server = server @param = OpenStruct.new setup end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
40 41 42 |
# File 'lib/ellipses/client/command.rb', line 40 def argv @argv end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
40 41 42 |
# File 'lib/ellipses/client/command.rb', line 40 def server @server end |
Instance Method Details
#call(input, **kwargs) ⇒ Object
52 53 54 |
# File 'lib/ellipses/client/command.rb', line 52 def call(input, **kwargs) raise NotImplementedError end |
#error(*args) ⇒ Object
56 57 58 |
# File 'lib/ellipses/client/command.rb', line 56 def error(*args) raise Error, *args end |
#setup ⇒ Object
50 |
# File 'lib/ellipses/client/command.rb', line 50 def setup; end |
#to_s ⇒ Object
60 61 62 |
# File 'lib/ellipses/client/command.rb', line 60 def to_s self.class.name.downcase end |