るりまサーチ

最速Rubyリファレンスマニュアル検索!
6289件ヒット [1-100件を表示] (0.155秒)
トップページ > クエリ:i[x] > クエリ:end[x] > クエリ:|[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

irb (26156.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...irb は Interactive Ruby の略です。
i
rb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

=== irb の使い方

Ruby さえ知っていれば irb を使うのは簡単です。
i
rb コマンドを実行すると、以下のようなプロン...
...$ irb
i
rb(main):001:0>

あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。

i
rb(main):001:0> 1+2
3
i
rb(main):002:0> class Foo
i
rb(main):003:1> def foo
i
rb(main):004:2> print 1
i
rb(main):005:2> end
i
rb(main):006:1> end...
...ブジェクトに
I
RB::Context オブジェクトを渡して実行します。
これによってサブ irb の設定をまとめて設定することができます。

以下に例を示します。

$ irb
i
rb(main):001:0> IRB.conf[:IRB_RC] = lambda {|conf| conf.prompt_i = "> " }
=> #<Proc...

Enumerator::ArithmeticSequence#end -> Numeric | nil (21302.0)

末項(終端)を返します。

...末項(終端)を返します。

@see Enumerator::ArithmeticSequence#begin...

Shell::Filter#|(filter) -> object (21254.0)

パイプ結合を filter に対して行います。

...パイプ結合を filter に対して行います。

@param filter Shell::Filter オブジェクトを指定します。

@return filter を返します。

使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Sh...
...ell.new
sh.transact {
i
= 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i
+= 1
end

}...

MatchData#end(n) -> Integer | nil (18338.0)

n 番目の部分文字列終端のオフセットを返します。

...nil を返します。

@param n 部分文字列を指定する数値。

@raise IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end...
...(4) # => `end': index 4 out of matches (IndexError)
//}

@see MatchData#begin...

TracePoint#binding -> Binding | nil (15525.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...れた Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
ret
end

trace = TracePoint.new(:...
...call) do |tp|
p tp.binding.local_variables # => [:ret]
end

trace.enable
foo 1
//}...

絞り込み条件を変える

TracePoint#binding -> Binding (15424.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...発生したイベントによって生成された Binding オブジェクトを返します。


//emlist[例][ruby]{
def foo(ret)
ret
end

trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end

trace.enable
foo 1
//}...

OpenSSL::SSL::SSLSocket#pending -> Integer | nil (12401.0)

OpenSSL内部のバッファが保持している、直ちに読み取り可能な データのバイト数を返します。

...OpenSSL内部のバッファが保持している、直ちに読み取り可能な
データのバイト数を返します。

ハンドシェイク開始前には nil を返します。...

Pathname#opendir {|dir| ... } -> nil (12401.0)

Dir.open(self.to_s, &block) と同じです。

...Dir.open(self.to_s, &block) と同じです。


@see Dir.open...

ObjectSpace.#define_finalizer(obj) {|id| ...} -> Array (12343.0)

obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。

...ロックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するの...
...回収時に obj の ID を引数として実行されます。

=== 使い方の注意

以下は、define_finalizer の使い方の悪い例です。

//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end

end

Foo.new
GC.start
//...
...file は、ファイナライザの使い方の
良い例になっています。これは、クラスのコンテキストで Proc を
生成することで上記の問題を回避しています。

//emlist[例][ruby]{
class Bar
def Bar.callback
proc {
puts "bar"
}
end

def ini...

Kernel$$INPUT_LINE_NUMBER -> Integer (12324.0)

$. の別名

...$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5...

絞り込み条件を変える

Net::SMTP#send_mail(mailsrc, from_addr, *to_addrs) -> () (12306.0)

メールを送信します。

...メールを送信します。

mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に...
...で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}

sendmail は obsolete です。

@param mailsrc メールの内容
@par...
...少なくとも1個)

@raise IOError すでにセッションが終了している場合に発生します
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::SMTPServerBusy SMTPエラーコード420,450の場合に発生します
@raise Net::SMTPSyntaxError SMT...
<< 1 2 3 ... > >>