絶賛RubyOnWindows読書中
RubyでOLEオブジェクトのメソッド定義を調べる方法が気に入った。
require 'win32ole' ie = WIN32OLE.new("InternetExplorer.Application") puts ie.ole_obj_help.to_s method = ie.ole_method_help("Navigate2") puts method.return_type method.params.each do |param| str = "" str.concat "[in] " if param.input? str.concat "[out] " if param.output? str.concat "[optional] " if param.optional? str.concat "[retval] " if param.retval? str.concat param.name str.concat " = #{param.default}" if param.default str.concat " As #{param.ole_type}" puts str end #>ruby sample.rb #IWebBrowser2 #VOID #[in] URL As VARIANT #[in] [optional] Flags As VARIANT #[in] [optional] TargetFrameName As VARIANT #[in] [optional] PostData As VARIANT #[in] [optional] Headers As VARIANT