Class: TridentAssistant::CLI::Base
- Inherits:
-
Thor
- Object
- Thor
- TridentAssistant::CLI::Base
- Defined in:
- lib/trident_assistant/cli/base.rb
Overview
Base class of CLI
Direct Known Subclasses
Collectible, Collection, Command, Metadata, NFO, Order, Utils
Constant Summary collapse
- UI =
::CLI::UI
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#keystore ⇒ Object
readonly
Returns the value of attribute keystore.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(*args) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trident_assistant/cli/base.rb', line 14 def initialize(*args) super endpoint = [:endpoint] || "https://thetrident.one" @api = begin TridentAssistant::API.new( endpoint: endpoint, keystore: [:keystore] ) rescue JSON::ParserError log UI.fmt("{{x}} falied to parse keystore.json: #{[:keystore]}") rescue StandardError => e log UI.fmt "{{x}} Failed to initialize Mixin bot, maybe your keystore is incorrect. #{e.inspect}" end end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
12 13 14 |
# File 'lib/trident_assistant/cli/base.rb', line 12 def api @api end |
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
12 13 14 |
# File 'lib/trident_assistant/cli/base.rb', line 12 def bot @bot end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
12 13 14 |
# File 'lib/trident_assistant/cli/base.rb', line 12 def client @client end |
#keystore ⇒ Object (readonly)
Returns the value of attribute keystore.
12 13 14 |
# File 'lib/trident_assistant/cli/base.rb', line 12 def keystore @keystore end |