hirura/hrr_rb_ssh

View on GitHub
lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/subsystem/context.rb

Summary

Maintainability
A
1 hr
Test Coverage
module HrrRbSsh
  class Connection
    class Channel
      class ChannelType
        class Session
          class RequestType
            class Subsystem
              class Context
                include Loggable

                attr_reader \
                  :username,
                  :io,
                  :variables,
                  :vars,
                  :subsystem_name

                def initialize proc_chain, username, io, variables, message, session, logger: nil
                  self.logger = logger

                  @proc_chain = proc_chain
                  @username   = username
                  @io         = io
                  @variables  = variables
                  @vars       = variables
                  @session    = session

                  @subsystem_name = message[:'subsystem name']
                end

                def chain_proc &block
                  @proc = block || @proc
                end

                def close_session
                  @session.close
                end
              end
            end
          end
        end
      end
    end
  end
end