Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > win32oleライブラリ > WIN32OLE_TYPELIBクラス
クラスの継承リスト: WIN32OLE_TYPELIB < Object < Kernel < BasicObject
OLEオートメーションサーバの型情報ライブラリ(TypeLib)を操作するためのクラスです。
OLEオートメーションサーバはクライアントに、クラス、インターフェイス、メソッドなどのメタデータを提供するための機構を持ちます。この情報は拡張子からTLBと呼ばれるライブラリまたはオートメーションサーバのプログラム内のリソースとして保持され、クライアントからの要求によって参照可能となります。
WIN32OLE_TYPELIBクラスは、TypeLibを操作して各種情報を参照するためのオブジェクトを生成します。
require 'win32ole' tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library') puts "Guid of Excel typelib = #{tlib.guid}" puts "version = #{tlib.major_version}.#{tlib.minor_version}" puts "creatable classes:" tlib.ole_types.select{|cls| cls.progid }.each do |cls| puts " #{cls.name}: PROGID=#{cls.progid}" end
上記を実行すると以下の出力を得ます。
Guid of Excel typelib = {00020813-0000-0000-C000-000000000046} version = 1.7 creatable classes: Application: PROGID=Excel.Application.14 Chart: PROGID=Excel.Chart.8 Worksheet: PROGID=Excel.Sheet.8
ここでは、Excelのクラスのうち、WIN32OLE.newで作成可能なクラスを引数で指定する名前(PROGID)と共に示しています。
定義 | 説明 | |
---|---|---|
new(libname, mjv = nil, miv = nil) -> WIN32OLE_TYPELIB
|
WIN32OLE_TYPELIBオブジェクトを生成します。 |
|
typelibs -> [WIN32OLE_TYPELIB]
|
システムに登録されているすべてのTypeLibを取得します。 |
定義 | 説明 | |
---|---|---|
guid -> String
|
TypeLibのGUIDを取得します。 |
|
library_name -> String
|
TypeLibのヘルプファイル用ドキュメント文字列からTypeLibの名前を取得します。 |
|
major_version -> Integer
|
TypeLibのメジャーバージョン番号を取得します。 |
|
minor_version -> Integer
|
TypeLibのマイナーバージョン番号を取得します。 |
|
name -> String
|
TypeLibのドキュメント文字列を取得します。 |
|
ole_types -> [WIN32OLE_TYPE]
|
TypeLibに格納されているすべての型を取得します。 |
|
path -> String
|
TypeLibのパス名を取得します。 |
|
version -> Float
|
TypeLibのバージョン番号を取得します。 |
|
visible? -> bool
|
TypeLibの情報が公開情報かどうかを照会します。 |
!
!=
==
===
=~
__id__
__send__
_dump
class
clone
dclone
display
enum_for
eql?
equal?
extend
freeze
frozen?
hash
initialize
initialize_copy
inspect
instance_eval
instance_exec
instance_of?
instance_variable_defined?
instance_variable_get
instance_variable_set
instance_variables
is_a?
marshal_dump
marshal_load
method
method_missing
methods
must_be
must_be_close_to
must_be_empty
must_be_instance_of
must_be_kind_of
must_be_nil
must_be_same_as
must_be_within_epsilon
must_equal
must_include
must_match
must_raise
must_respond_to
must_send
must_throw
nil?
pretty_inspect
pretty_print
pretty_print_cycle
pretty_print_inspect
pretty_print_instance_variables
private_methods
protected_methods
public_methods
remove_instance_variable
respond_to?
respond_to_missing?
singleton_class
singleton_method_added
singleton_method_removed
singleton_method_undefined
singleton_methods
taint
tainted?
tap
to_a
to_ary
to_hash
to_int
to_io
to_proc
to_regexp
to_str
to_yaml
to_yaml_properties
to_yaml_style
trust
untaint
untrust
untrusted?
wont_be
wont_be_close_to
wont_be_empty
wont_be_instance_of
wont_be_kind_of
wont_be_nil
wont_be_same_as
wont_be_within_epsilon
wont_equal
wont_include
wont_match
wont_respond_to