class SuperHub2
Attributes
fw[R]
Public Class Methods
new(host_ip='192.168.0.1', passwordx=nil, headless: true, password: passwordx, timeout: 10, debug: false, verbose: true)
click to toggle source
# File lib/virginsuperhub.rb, line 14 def initialize(host_ip='192.168.0.1', passwordx=nil, headless: true, password: passwordx, timeout: 10, debug: false, verbose: true) @headless, @verbose = headless, verbose puts "SuperHub2".highlight; puts if verbose @fw = FerrumWizard.new("http://#{host_ip}/VmLogin.asp", headless: headless, debug: debug, timeout: timeout) login(password) if password end
Public Instance Methods
login(password)
click to toggle source
# File lib/virginsuperhub.rb, line 27 def login(password) @fw.login(nil, password) puts 'logged in'.info if @verbose sleep 2 self end
logout()
click to toggle source
# File lib/virginsuperhub.rb, line 60 def logout() @fw.sign_out puts 'signed out'.info if @verbose sleep 2 unless @headless @fw.quit end
reboot()
click to toggle source
# File lib/virginsuperhub.rb, line 36 def reboot() @fw.advanced.reboot.reboot puts 'rebooting ...'.info if @verbose sleep 2 unless @headless @fw.quit puts 'browser window closed'.info if @verbose end
wifi(state)
click to toggle source
# File lib/virginsuperhub.rb, line 48 def wifi(state) @fw.wireless.method(state.to_sym).call.save.apply(2) puts ('Wifi is now ' + state.to_s).info if @verbose sleep 2 self end
wifi_off()
click to toggle source
# File lib/virginsuperhub.rb, line 58 def wifi_off() wifi(:off) end
wifi_on()
click to toggle source
# File lib/virginsuperhub.rb, line 57 def wifi_on() wifi(:on) end