Class: Nanobot::Config::ChannelsConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/nanobot/config/schema.rb

Overview

Collection of all messaging channel configurations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(telegram: {}, discord: {}, gateway: {}, slack: {}, email: {}) ⇒ ChannelsConfig

Returns a new instance of ChannelsConfig.

Parameters:

  • telegram (Hash) (defaults to: {}) —

    Telegram channel settings (see TelegramConfig)

  • discord (Hash) (defaults to: {}) —

    Discord channel settings (see DiscordConfig)

  • gateway (Hash) (defaults to: {}) —

    HTTP gateway settings (see GatewayConfig)

  • slack (Hash) (defaults to: {}) —

    Slack channel settings (see SlackConfig)

  • email (Hash) (defaults to: {}) —

    email channel settings (see EmailConfig)



239
240
241
242
243
244
245
246
247
# File 'lib/nanobot/config/schema.rb', line 239

def initialize(telegram: {}, discord: {}, gateway: {}, slack: {}, email: {})
  super(
    telegram: TelegramConfig.new(**(telegram.is_a?(Hash) ? telegram : {})),
    discord: DiscordConfig.new(**(discord.is_a?(Hash) ? discord : {})),
    gateway: GatewayConfig.new(**(gateway.is_a?(Hash) ? gateway : {})),
    slack: SlackConfig.new(**(slack.is_a?(Hash) ? slack : {})),
    email: EmailConfig.new(**(email.is_a?(Hash) ? email : {}))
  )
end

Instance Attribute Details

#discord ⇒ Object

Returns the value of attribute discord

Returns:

  • (Object) —

    the current value of discord



233
234
235
# File 'lib/nanobot/config/schema.rb', line 233

def discord
  @discord
end

#email ⇒ Object

Returns the value of attribute email

Returns:

  • (Object) —

    the current value of email



233
234
235
# File 'lib/nanobot/config/schema.rb', line 233

def email
  @email
end

#gateway ⇒ Object

Returns the value of attribute gateway

Returns:

  • (Object) —

    the current value of gateway



233
234
235
# File 'lib/nanobot/config/schema.rb', line 233

def gateway
  @gateway
end

#slack ⇒ Object

Returns the value of attribute slack

Returns:

  • (Object) —

    the current value of slack



233
234
235
# File 'lib/nanobot/config/schema.rb', line 233

def slack
  @slack
end

#telegram ⇒ Object

Returns the value of attribute telegram

Returns:

  • (Object) —

    the current value of telegram



233
234
235
# File 'lib/nanobot/config/schema.rb', line 233

def telegram
  @telegram
end