class Lita::Interactors::ShowService

Show service

Attributes

data[R]

Public Class Methods

new(handler, data) click to toggle source
# File lib/lita/interactors/show_service.rb, line 12
def initialize(handler, data)
  @handler = handler
  @data = data
end

Public Instance Methods

perform() click to toggle source
# File lib/lita/interactors/show_service.rb, line 17
def perform
  if service_exists?
    @message = service
  else
    @error = msg_not_found(service_name: name)
  end
  self
end

Private Instance Methods

name() click to toggle source
# File lib/lita/interactors/show_service.rb, line 28
def name
  @name ||= data[1]
end
service() click to toggle source
# File lib/lita/interactors/show_service.rb, line 32
def service
  @service ||= repository.find(name)
end
service_exists?() click to toggle source
# File lib/lita/interactors/show_service.rb, line 36
def service_exists?
  repository.exists?(name)
end