class SlackRespondent::Commands::Support::Attrs

Attributes

command_desc[RW]
command_long_desc[RW]
command_name[RW]
commands[R]
klass[R]

Public Class Methods

new(klass) click to toggle source
# File lib/slack_respondent/commands/support/attrs.rb, line 8
def initialize(klass)
  @klass = klass
  @commands = []
end

Public Instance Methods

command(title, &block) click to toggle source
# File lib/slack_respondent/commands/support/attrs.rb, line 25
def command(title, &block)
  @commands << self.class.new(klass).tap do |k|
    k.title(title)
    k.instance_eval(&block)
  end
end
desc(desc) click to toggle source
# File lib/slack_respondent/commands/support/attrs.rb, line 17
def desc(desc)
  self.command_desc = desc
end
long_desc(long_desc) click to toggle source
# File lib/slack_respondent/commands/support/attrs.rb, line 21
def long_desc(long_desc)
  self.command_long_desc = long_desc
end
title(title) click to toggle source
# File lib/slack_respondent/commands/support/attrs.rb, line 13
def title(title)
  self.command_name = title
end