Class: Shhh::App::Commands::Command
- Inherits:
-
Object
- Object
- Shhh::App::Commands::Command
show all
- Defined in:
- lib/shhh/app/commands/command.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(application) ⇒ Command
Returns a new instance of Command.
51
52
53
|
# File 'lib/shhh/app/commands/command.rb', line 51
def initialize(application)
self.application = application
end
|
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
49
50
51
|
# File 'lib/shhh/app/commands/command.rb', line 49
def application
@application
end
|
Instance Method Details
#key ⇒ Object
62
63
64
|
# File 'lib/shhh/app/commands/command.rb', line 62
def key
@key ||= application.key
end
|
#opts ⇒ Object
55
56
57
|
# File 'lib/shhh/app/commands/command.rb', line 55
def opts
application.opts
end
|
#opts_hash ⇒ Object
58
59
60
|
# File 'lib/shhh/app/commands/command.rb', line 58
def opts_hash
application.opts_hash
end
|
#to_s ⇒ Object
70
71
72
|
# File 'lib/shhh/app/commands/command.rb', line 70
def to_s
"#{self.class.short_name.to_s.bold.yellow}, with options: #{application.args.argv.join(' ').gsub(/--/, '').bold.green}"
end
|