Class: Slocks::TemplateHandlerDispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/slocks/template_handler.rb

Class Method Summary collapse

Class Method Details

.call(template, source = nil) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/slocks/template_handler.rb', line 7

def self.call(template, source = nil)
  case template.format&.to_sym
  when :slack_modal
    ModalTemplateHandler.call(template, source)
  else
    BlocksTemplateHandler.call(template, source)
  end
end

.default_format ⇒ Object



16
# File 'lib/slocks/template_handler.rb', line 16

def self.default_format = :slack_message

.handles_encoding? ⇒ Boolean

Returns:

  • (Boolean)


17
# File 'lib/slocks/template_handler.rb', line 17

def self.handles_encoding? = true

.translate_location(spot, backtrace_location, source) ⇒ Object



19
20
21
# File 'lib/slocks/template_handler.rb', line 19

def self.translate_location(spot, backtrace_location, source)
  BlocksTemplateHandler.translate_location(spot, backtrace_location, source)
end