Class: VpsAdmin::CLI::Commands::VpsRemoteControl::HttpClient
- Inherits:
-
Object
- Object
- VpsAdmin::CLI::Commands::VpsRemoteControl::HttpClient
- Defined in:
- lib/vpsadmin/cli/commands/vps_remote_console.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(vps, token, rate) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #join ⇒ Object
- #resize(width, height) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #stop? ⇒ Boolean
- #write(data) ⇒ Object
Constructor Details
#initialize(vps, token, rate) ⇒ HttpClient
Returns a new instance of HttpClient.
90 91 92 93 94 95 96 97 98 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 90 def initialize(vps, token, rate) @vps = vps @token = token @rate = rate @mutex = Mutex.new @write_buffer = '' @stop = false @error = false end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
116 117 118 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 116 def error @error end |
Instance Method Details
#error? ⇒ Boolean
112 113 114 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 112 def error? @error != false end |
#join ⇒ Object
118 119 120 121 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 118 def join stop thread.join end |
#resize(width, height) ⇒ Object
129 130 131 132 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 129 def resize(width, height) @width = width @height = height end |
#start ⇒ Object
100 101 102 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 100 def start @thread = Thread.new { run } end |
#stop ⇒ Object
104 105 106 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 104 def stop @stop = true end |
#stop? ⇒ Boolean
108 109 110 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 108 def stop? @stop end |
#write(data) ⇒ Object
123 124 125 126 127 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 123 def write(data) mutex.synchronize do write_buffer << data end end |