Class: Turbot::Command::Base
- Inherits:
-
Object
- Object
- Turbot::Command::Base
- Includes:
- Helpers
- Defined in:
- lib/turbot/command/base.rb
Constant Summary
Constants included from Helpers
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #bot ⇒ Object
-
#initialize(args = [], options = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Helpers
#api, #ask, #ask_for_password, #ask_for_password_on_windows, #delete_netrc_entry, #email_address_and_api_key, #error, #format_error, #host, #netrc_exists?, #netrc_path, #open_netrc, #save_netrc_entry, #styled_error, #turbot_api, #turbot_api_parameters
Constructor Details
#initialize(args = [], options = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 |
# File 'lib/turbot/command/base.rb', line 11 def initialize(args = [], = {}) @args = args @options = end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/turbot/command/base.rb', line 8 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/turbot/command/base.rb', line 9 def @options end |
Class Method Details
.namespace ⇒ Object
4 5 6 |
# File 'lib/turbot/command/base.rb', line 4 def self.namespace self.to_s.split('::').last.downcase end |
Instance Method Details
#bot ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/turbot/command/base.rb', line 16 def bot @bot ||= if [:bot].is_a?(String) [:bot] elsif ENV['TURBOT_BOT'] ENV['TURBOT_BOT'] elsif manifest = parse_manifest manifest['bot_id'] end end |