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.
47
48
49
|
# File 'lib/shhh/app/commands/command.rb', line 47
def initialize(application)
self.application = application
end
|
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
45
46
47
|
# File 'lib/shhh/app/commands/command.rb', line 45
def application
@application
end
|
Instance Method Details
#key ⇒ Object
58
59
60
|
# File 'lib/shhh/app/commands/command.rb', line 58
def key
@key ||= application.key
end
|
#opts ⇒ Object
51
52
53
|
# File 'lib/shhh/app/commands/command.rb', line 51
def opts
application.opts
end
|
#opts_hash ⇒ Object
54
55
56
|
# File 'lib/shhh/app/commands/command.rb', line 54
def opts_hash
application.opts_hash
end
|
#to_s ⇒ Object
66
67
68
|
# File 'lib/shhh/app/commands/command.rb', line 66
def to_s
"#{self.class.short_name.to_s.bold.yellow}, with options: #{application.args.argv.join(' ').gsub(/--/, '').bold.green}"
end
|