Ruby 2.5.0 リファレンスマニュアル > ライブラリ一覧 > 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__
instance_eval
instance_exec
method_missing
singleton_method_added
singleton_method_removed
singleton_method_undefined
!~
<=>
==
===
=~
_dump
class
clone
define_singleton_method
display
enum_for
eql?
equal?
extend
freeze
frozen?
hash
initialize
initialize_copy
inspect
instance_of?
instance_variable_defined?
instance_variable_get
instance_variable_set
instance_variables
is_a?
itself
marshal_dump
marshal_load
method
methods
nil?
object_id
pretty_inspect
pretty_print
pretty_print_cycle
pretty_print_inspect
pretty_print_instance_variables
private_methods
protected_methods
psych_to_yaml
public_method
public_methods
public_send
remove_instance_variable
respond_to?
respond_to_missing?
send
singleton_class
singleton_method
singleton_methods
taint
tainted?
tap
to_a
to_ary
to_hash
to_int
to_io
to_proc
to_regexp
to_str
trust
untaint
untrust
untrusted?
yield_self
.yaml_tag
::ARGF
::ARGV
::DATA
::ENV
::FALSE
::NIL
::RUBY_COPYRIGHT
::RUBY_DESCRIPTION
::RUBY_ENGINE
::RUBY_ENGINE_VERSION
::RUBY_PATCHLEVEL
::RUBY_PLATFORM
::RUBY_RELEASE_DATE
::RUBY_REVISION
::RUBY_VERSION
::SCRIPT_LINES__
::STDERR
::STDIN
::STDOUT
::TOPLEVEL_BINDING
::TRUE