別のキーワード
クラス
-
ARGF
. class (72) - Array (24)
- BasicObject (72)
- Class (12)
- Hash (74)
- Integer (12)
- Method (93)
- Module (300)
- Object (120)
- OptionParser (144)
- Proc (14)
-
Thread
:: Backtrace :: Location (36) - TracePoint (12)
- UnboundMethod (12)
-
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (48)
キーワード
- ! (12)
- != (12)
- < (12)
- << (14)
- <=> (12)
- == (12)
- === (8)
- >> (14)
- [] (12)
-
_ dump (12) -
absolute
_ path (12) -
append
_ features (12) - autoload (12)
-
base
_ label (12) - bind (12)
- binmode (12)
- call (24)
-
class
_ eval (24) -
class
_ exec (12) - clone (12)
- close (12)
-
default
_ event _ sources (12) -
define
_ singleton _ method (24) -
defined
_ class (12) - display (12)
- dup (12)
-
each
_ char (24) -
each
_ entry (24) - extend (12)
- getbyte (12)
- getc (12)
- include (12)
- include? (12)
- included (12)
- inherited (12)
-
initialize
_ copy (12) - inspect (12)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
marshal
_ load (12) - merge (24)
-
module
_ eval (24) -
module
_ exec (12) - on (144)
- prepend (12)
-
prepend
_ features (12) - prepended (12)
-
pretty
_ print (12) -
private
_ class _ method (24) -
private
_ constant (12) -
public
_ class _ method (24) -
public
_ constant (12) -
remove
_ method (12) - replace (12)
-
singleton
_ methods (12) -
sort
_ by (24) -
super
_ method (11) -
to
_ a (12) -
to
_ ary (12) -
to
_ bn (12) -
to
_ h (14) -
to
_ s (24) -
undef
_ method (12)
検索結果
先頭5件
-
ARGF
. class # getbyte -> Integer | nil (3047.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
...
self から 1 バイト(0..255)を読み込み整数として返します。
既に EOF に達していれば nil を返します。
ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想フ......cho "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getbyte # => 102
ARGF.getbyte # => 111
ARGF.getbyte # => 111
ARGF.getbyte # => 10
ARGF.getbyte # => 98
ARGF.getbyte # => 97
ARGF.getbyte # => 114
ARGF.getbyte # => 10
ARGF.getbyte # => nil
@see ARGF.class#getc, ARGF.class#gets... -
ARGF
. class # getc -> String | nil (3047.0) -
self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。
...
self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。
ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェ......foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getc # => "f"
ARGF.getc # => "o"
ARGF.getc # => "o"
ARGF.getc # => "\n"
ARGF.getc # => "b"
ARGF.getc # => "a"
ARGF.getc # => "r"
ARGF.getc # => "\n"
ARGF.getc # => nil
@see ARGF.class#getbyte, ARGF.class#gets... -
ARGF
. class # each _ char -> Enumerator (3026.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...ァイル名を得るには
ARGF.class#filename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# t......est.rb
ARGF.each_char # => #<Enumerator: ARGF:each_char>
ARGF.each_char{|e|p e}
# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"
@see IO#each_char... -
Module
# append _ features(module _ or _ class) -> self (267.0) -
モジュール(あるいはクラス)に self の機能を追加します。
...モジュール(あるいはクラス)に self の機能を追加します。
このメソッドは Module#include の実体であり、
include を Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def include(*modules)
modules.reverse_each do |mod|
# append_fea......tures や included はプライベートメソッドなので
# 直接 mod.append_features(self) などとは書けない
mod.__send__(:append_features, self)
mod.__send__(:included, self)
end
end
//}
@see Module#included... -
OptionParser
# on(long , pat = / . * / , desc = "") {|v| . . . } -> self (207.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param pat オプションの......引数に許すパターンを表す正規表現で指定します。
@param desc オプションの説明を文字列で与えます。サマリに表示されます。... -
OptionParser
# on(short , long , pat = / . * / , desc = "") {|v| . . . } -> self (207.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param pat オプションの......引数に許すパターンを表す正規表現で指定します。
@param desc オプションの説明を文字列で与えます。サマリに表示されます。... -
OptionParser
# on(short , pat = / . * / , desc = "") {|v| . . . } -> self (207.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param pat オプションの......引数に許すパターンを表す正規表現で指定します。
@param desc オプションの説明を文字列で与えます。サマリに表示されます。... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (205.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...て追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メ......1][ruby]{
Parent = Class.new
class <<Parent
private; def private_class_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end
Foo = Class.new(Parent)
class <<Foo
private; def private_class_foo() end
protected; def protected_class_foo()......lic_class_foo() end
end
module Bar
private; def private_bar() end
protected; def protected_bar() end
public; def public_bar() end
end
obj = Foo.new
class <<obj
include Bar
private; def private_self() end
protected; def protected_self() end
public; def public_self()... -
Hash
# merge(*others) {|key , self _ val , other _ val| . . . } -> Hash (200.0) -
selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。 デフォルト値はselfの設定のままです。
...
selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。
デフォルト値はselfの設定のままです。
self と others に同じキーがあった場合はブロック付きか否かで
判定方法が違います。ブロック付きのときはブ......to_hashを使って暗黙の変換を試みます。
@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結果を返します
//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246,......newval| newval - oldval}
#=> {"a"=>100, "b"=>311, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200}
//}
//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4 => 'D'}
p foo.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #... -
Hash
# merge(other) {|key , self _ val , other _ val| . . . } -> Hash (200.0) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
self と other に同じキーがあった場合はブロック付きか否かで
判定方法が違います。ブロック付きのときはブロックを......to_hashを使って暗黙の変換を試みます。
@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結果を返します
//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254,......{|key, oldval, newval| newval - oldval}
# => {"a"=>100, "b"=>54, "c"=>300}
h1 # => {"a"=>100, "b"=>200}
//}
//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4 => 'D'}
p foo.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #...