Class: Qiita::Team::Services::Hooks::Base Abstract

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Concerns::EventHandlable, Concerns::Persistable, Concerns::Service
Defined in:
lib/qiita/team/services/hooks/base.rb

Overview

This class is abstract.

Direct Known Subclasses

ChatworkV1, HipchatV1, SlackV1, SlackV2, Webhook

Class Method Summary collapse

Methods included from Concerns::Service

#name

Methods included from Concerns::Persistable

#initialize, #marked_for_destruction?, #to_hash

Methods included from Concerns::EventHandlable

#handle

Class Method Details

.human_attribute_name(attr, _options = {}) ⇒ String

Parameters:

  • attr (String)

Returns:

  • (String)


22
23
24
# File 'lib/qiita/team/services/hooks/base.rb', line 22

def human_attribute_name(attr, _options = {})
  I18n.t("qiita.team.services.hooks.#{hook_type}.#{attr}")
end

.render_form(binding) ⇒ String

Returns:

  • (String)


27
28
29
# File 'lib/qiita/team/services/hooks/base.rb', line 27

def render_form(binding)
  ERB.new(form_template).result(binding)
end