Method: Codebot::Formatters::Ping#format_scope
- Defined in:
- lib/codebot/formatters/ping.rb
#format_scope ⇒ String
Formats the name of the repository or organization the webhook belongs to.
68 69 70 71 72 73 74 75 76 |
# File 'lib/codebot/formatters/ping.rb', line 68 def format_scope case extract(:hook, :type) when /\Aorganization\z/i format_user extract(:organization, :login) when /\Arepository\z/i login = extract(:repository, :owner, :login) "#{format_user login}/#{format_repository repository_name}" end end |