Sha256: f921ecdcec0d26fa93923873e30230e6da9822e89743c43ac86873876226a9a2

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

require 'win32ole'

module Caculo
  class InternetExplorer < Browser

    def initialize
      @ie = WIN32OLE.new('InternetExplorer.Application')
      @ie.visible = true
    end

    def read
      @ie.Document.parentWindow.caculoResult;
    end

    def send_command cmd
      @ie.Document.parentWindow.execScript( "window.caculoResult = ''");
      @ie.Document.parentWindow.execScript( "window.caculoResult = #{cmd};\n")
      read
    end

    def location= url
      sleep 0.2
      @ie.navigate( url )
    end

    def location
      @ie.locationURL
    end

    def page_loaded?
      !@ie.Busy
    end

    def current_window
      "window"
    end

    def back
      @ie.goback
    end

    def forward
      @ie.goforward
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cohitre-caculo-0.0.4 lib/caculo/internet_explorer.rb
cohitre-caculo-0.0.6 lib/caculo/internet_explorer.rb
cohitre-caculo-0.0.7 lib/caculo/internet_explorer.rb