Class: DComm::CLI::Command

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/dcomm/cli/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(discord: nil, renderer: nil) ⇒ Command

rubocop:disable Lint/MissingSuper



12
13
14
15
16
17
18
19
20
# File 'lib/dcomm/cli/command.rb', line 12

def initialize(discord: nil, renderer: nil) # rubocop:disable Lint/MissingSuper
  require 'dcomm/config'

  @discord = discord || DiscordAPI.new(
    auth_header: "Bot #{DComm.config.discord_bot_token}",
  )

  @renderer = renderer || Renderer.new
end

Instance Attribute Details

#discordObject (readonly)

Returns the value of attribute discord.



10
11
12
# File 'lib/dcomm/cli/command.rb', line 10

def discord
  @discord
end

#rendererObject (readonly)

Returns the value of attribute renderer.



10
11
12
# File 'lib/dcomm/cli/command.rb', line 10

def renderer
  @renderer
end