class Qiita::Team::Services::Hooks::Base

@abstract

Public Class Methods

human_attribute_name(attr, _options = {}) click to toggle source

@param attr [String] @return [String]

# 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) click to toggle source

@return [String]

# File lib/qiita/team/services/hooks/base.rb, line 27
def render_form(binding)
  ERB.new(form_template).result(binding)
end

Private Class Methods

form_template() click to toggle source

@return [String]

# File lib/qiita/team/services/hooks/base.rb, line 39
def form_template
  File.read(File.expand_path("../../templates/#{hook_type}.html.erb", __FILE__))
end
inherited(child) click to toggle source
Calls superclass method
# File lib/qiita/team/services/hooks/base.rb, line 33
def inherited(child)
  super
  Hooks.all_hooks << child
end