title: Change architecture of Ruby app to be more object oriented, readable
body: <p>I'm working on a Slack bot for service desk which sends direct message to user on a Slack when their ticket will be on <code>user_action_needed</code> status. I'm using AWS Lambda to handle Jira incoming webhooks. Everything works well but I think I've got an issue with whole architecture of the app - I quess the code is not so readable, name of the class probably doesn't match what they do.</p>
  
  <p>First of all I've got the <code>handler</code> on AWS lambda:</p>
  
  <pre><code>  module JiraHandler
      extend self
      def handle(event:, _context:)
        Parsers::JiraParser.new(event).call
        { statusCode: 200 }
      end
    end
  </code></pre>
  
  <p><code>Parsers::JiraParser</code> is responsible not only for parsing events but it calls another class which grabs <code>userId</code> from Slack, and then inside of <code>GetUserId</code> I've got another class which sends message to user. So at the end if you call <code>Parsers::JiraParser</code> class you will receive slack message instead of parsed data.</p>
  
  <p>Details of what I wrote about each class below:</p>
  
  <p><code>Parsers::JiraParser</code></p>
  
  <pre><code>module Parsers
    class JiraParser
      def initialize(event)
        payload = event['body']
        @event = JSON.parse(payload)
      end
  
      def call
        ::Slack::GetUserId.new(reporter_email, reporter_name, ticket_number).call
      end
      # reporter_email, reporter_name, ticket_number are methods to pull data by .dig from event hash
  </code></pre>
  
  <p><code>GetUserId</code></p>
  
  <pre><code>  class GetUserId
      SLACK_LOOKUP_BY_EMAIL = 'https://slack.com/api/users.lookupByEmail'
  
      def initialize(email, name, ticket_number)
        @email = email
        @name = name
        @ticket_number = ticket_number
      end
  
      def call
        user_id = set_slack_user.dig('user', 'id')
        ::Slack::SlackMessenger.new(user_id, name, ticket_number).call
      end
  
      def set_slack_user
        HTTParty.get(SLACK_LOOKUP_BY_EMAIL, options)
      end
  </code></pre>
  
  <p><code>SlackMessanger</code></p>
  
  <pre><code>module Slack
    class SlackMessenger
      SLACK_API_ENDPOINT = 'https://slack.com/api/chat.postMessage'
  
      def initialize(user_id, name, ticket_number)
        @user_id = user_id
        @name = name
        @ticket_number = ticket_number
      end
  
      def call
        HTTParty.post(SLACK_API_ENDPOINT, body: params, headers: headers)
      end
  </code></pre>
  
  <p>I don't think this is a good approach, should I create an extra class where all those classes will be called? or maybe I should use monads?</p>