365件ヒット
[1-100件を表示]
(0.125秒)
ライブラリ
- ビルトイン (86)
- json (11)
-
rexml
/ document (33) - win32ole (77)
クラス
-
JSON
:: Parser (11) - Module (44)
- NameError (20)
- Object (11)
-
REXML
:: XPath (33) - Thread (11)
-
WIN32OLE
_ TYPE (11) -
WIN32OLE
_ VARIABLE (55)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
-
WIN32OLE
_ VARIABLE (11) - [] (11)
-
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) - each (11)
- first (11)
- irb (11)
-
local
_ variables (9) - match (11)
- new (11)
-
ole
_ type (11) -
ole
_ type _ detail (11) -
rb
_ alias _ variable (11) -
rb
_ define _ class _ variable (11) -
rb
_ define _ hooked _ variable (11) -
rb
_ define _ readonly _ variable (11) -
rb
_ define _ variable (11) -
rb
_ define _ virtual _ variable (11) -
rb
_ obj _ remove _ instance _ variable (11) -
remove
_ class _ variable (11) -
remove
_ instance _ variable (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
to
_ s (22) - value (11)
- variables (11)
検索結果
先頭5件
-
irb (26120.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......readline ライブラリにも対応しています。
readline ライブラリがインストールされている時には
自動的にコマンドライン編集や履歴の機能が使えるようになります。
=== irb のコマンドラインオプション
irb [options] file_name opts......。
irb(main):004:0> x = "OK" # ローカル変数 x を定義
=> "OK"
irb(main):005:0> x # x を表示
=> "OK"
irb(main):006:0> irb # サブ irb を起動
irb#1(main):001:0> x # x を表示
NameError: undefined local variable or me... -
WIN32OLE
_ VARIABLE # name -> String (24219.0) -
変数名を取得します。
...変数名を取得します。
@return 変数名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end... -
void rb
_ alias _ variable(ID name1 , ID name2) (18600.0) -
-
NameError
# local _ variables -> [Symbol] (15200.0) -
self が発生した時に定義されていたローカル変数名の一覧を返します。
...発生した時に定義されていたローカル変数名の一覧を返します。
内部での使用に限ります。
例:
def foo
begin
b = "bar"
c = 123
d
rescue NameError => err
p err.local_variables #=> [:b, :c, :err]
end
end
a = "buz"
foo... -
WIN32OLE
_ TYPE # variables -> [WIN32OLE _ VARIABLE] (12425.0) -
型が持つ変数を取得します。
...メンバ変数の情報を
WIN32OLE_VARIABLEオブジェクトの配列として返します。
@return 型が持つ変数情報をWIN32OLE_VARIABLEの配列として返します。
変数を持たない場合は空配列を返します。
@raise WIN32OLERuntimeError 型属性が取得で......tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
vars = tobj.variables
vars.each do |v|
puts "#{v.name} = #{v.value}"
end
上記を実行すると以下の出力が得られます。
xlChart = -4109
xlDialogSheet = -4116
xlExcel4IntlMacro......Sheet = 4
xlExcel4MacroSheet = 3
xlWorksheet = -4167
@see WIN32OLE_VARIABLE... -
Object
# remove _ instance _ variable(name) -> object (12354.0) -
オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。
...ンス変数 name を取り除き、そのインス
タンス変数に設定されていた値を返します。
@param name 削除するインスタンス変数の名前をシンボルか文字列で指定します。
@raise NameError オブジェクトがインスタンス変数 name を持たな......い場合に発生します。
//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance variable @foo not defined (NameError)
end
end
Foo.new.foo
//}
@see Module#remove_class_variable,Module#remove_const... -
Module
# class _ variable _ defined?(name) -> bool (12348.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...
name で与えられた名前のクラス変数がモジュールに存在する場合 true を
返します。
@param name Symbol か String を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar......) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable_defined?('@@bar') #=> false
//}... -
Module
# class _ variable _ get(name) -> object (12336.0) -
クラス/モジュールに定義されているクラス変数 name の値を返します。
...るクラス変数 name の値を返します。
@param name String または Symbol を指定します。
@raise NameError クラス変数 name が定義されていない場合、発生します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
def Fred.foo
class_variable_get(:@@foo)
end... -
Module
# class _ variable _ set(name , val) -> object (12330.0) -
クラス/モジュールにクラス変数 name を定義して、その値として val をセットします。val を返します。
...にクラス変数 name を定義して、その値として
val をセットします。val を返します。
@param name String または Symbol を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
def foo
@@foo
end
end
def Fred.foo(val)
class_variable_set(:@@foo, val)... -
Module
# remove _ class _ variable(name) -> object (12326.0) -
引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。
...クラス変数に設定さ
れていた値を返します。
@param name String または Symbol を指定します。
@return 引数で指定されたクラス変数に設定されていた値を返します。
@raise NameError 引数で指定されたクラス変数がそのモジュールや......クラスに定義されていない場合に発生します。
//emlist[例][ruby]{
class Foo
@@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end
//}
@see Module#remove_const, Object#remove_instance_variable...