Class: Nanobot::Config::SlackDMConfig

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

Overview

Slack direct message policy configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: true, policy: 'open', allow_from: []) ⇒ SlackDMConfig

Returns a new instance of SlackDMConfig.

Parameters:

  • enabled (Boolean) (defaults to: true) —

    whether DM handling is active

  • policy (String) (defaults to: 'open') —

    access policy: "open" or "restricted"

  • allow_from (Array<String>) (defaults to: []) —

    allowed Slack user IDs when policy is restricted



159
160
161
# File 'lib/nanobot/config/schema.rb', line 159

def initialize(enabled: true, policy: 'open', allow_from: [])
  super
end

Instance Attribute Details

#allow_from ⇒ Object

Returns the value of attribute allow_from

Returns:

  • (Object) —

    the current value of allow_from



155
156
157
# File 'lib/nanobot/config/schema.rb', line 155

def allow_from
  @allow_from
end

#enabled ⇒ Object

Returns the value of attribute enabled

Returns:

  • (Object) —

    the current value of enabled



155
156
157
# File 'lib/nanobot/config/schema.rb', line 155

def enabled
  @enabled
end

#policy ⇒ Object

Returns the value of attribute policy

Returns:

  • (Object) —

    the current value of policy



155
156
157
# File 'lib/nanobot/config/schema.rb', line 155

def policy
  @policy
end