Class: HrrRbSsh::Connection::Channel::ChannelType::Session::RequestType::Env::Context

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb

Instance Attribute Summary collapse

Attributes included from Loggable

#log_key, #logger

Instance Method Summary collapse

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn

Constructor Details

#initialize(proc_chain, username, io, variables, message, session, logger: nil) ⇒ Context

Returns a new instance of Context.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 24

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

  @variable_name  = message[:'variable name']
  @variable_value = message[:'variable value']
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def io
  @io
end

#usernameObject (readonly)

Returns the value of attribute username.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def username
  @username
end

#variable_nameObject (readonly)

Returns the value of attribute variable_name.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def variable_name
  @variable_name
end

#variable_valueObject (readonly)

Returns the value of attribute variable_value.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def variable_value
  @variable_value
end

#variablesObject (readonly)

Returns the value of attribute variables.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def variables
  @variables
end

#varsObject (readonly)

Returns the value of attribute vars.



16
17
18
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 16

def vars
  @vars
end

Instance Method Details

#chain_proc(&block) ⇒ Object



38
39
40
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 38

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

#close_sessionObject



42
43
44
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb', line 42

def close_session
  @session.close
end