るりまサーチ

最速Rubyリファレンスマニュアル検索!
1929件ヒット [1-100件を表示] (0.092秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Tempfile#open -> self (18114.0)

クローズしたテンポラリファイルを再オープンします。 "r+" でオープンされるので、クローズ前の内容を再度読む ことができます。

...ァイルを再オープンします。
"r+" でオープンされるので、クローズ前の内容を再度読む
ことができます。

require
"tempfile"
tf = Tempfile.new("foo")
tf.print("foobar,hoge\n")
tf.print("bar,ugo\n")
tf.close
tf.open
p tf.gets # => "foobar,hoge\n"...

Net::SMTP#open_message_stream(from_addr, *to_addrs) {|f| .... } -> () (6114.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

...ス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。

require
'net/smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.p...

StringIO#reopen(str, mode = &#39;r+&#39;) -> StringIO (6114.0)

自身が表す文字列が指定された文字列 str になります。

...el.#open 同様文字列か整数で自身のモードを指定します。

@raise Errno::EACCES str がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。

//emlist[例][ruby]{
require
'stringio'
sio = StringIO.new("hoge", 'r+')
sio.reopen('f...

StringIO#reopen(sio) -> StringIO (6109.0)

自身が表す文字列が指定された StringIO と同じものになります。

...が指定された StringIO と同じものになります。

@param sio 自身が表したい StringIO を指定します。

//emlist[例][ruby]{
require
'stringio'
sio = StringIO.new("hoge", 'r+')
sio2 = StringIO.new("foo", 'r+')
sio.reopen(sio2)
p sio.read #=> "foo"
//}...

OpenURI::OpenRead#read(options = {}) -> String (6029.0)

自身が表す内容を読み込んで文字列として返します。 self.open(options={}) {|io| io.read } と同じです。 このメソッドによって返される文字列は OpenURI::Meta によって extend されています。

...字列として返します。
self.open(options={}) {|io| io.read } と同じです。
このメソッドによって返される文字列は OpenURI::Meta
によって extend されています。

@param options ハッシュを与えます。

require
'open-uri'
uri = URI.parse('http://www.ex...
...ample.com/')
str = uri.read
p str.is_a?(OpenURI::Meta) # => true
p str.content_type...

絞り込み条件を変える

OpenSSL::BN#>>(other) -> OpenSSL::BN (3107.0)

自身を other ビット右シフトした値を返します。

...自身を other ビット右シフトした値を返します。

//emlist[][ruby]{
require
'openssl'

bn = 2.to_bn
bn >> 1 # => #<OpenSSL::BN 1>
bn # => #<OpenSSL::BN 2>
//}

@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#rshift!...

OpenSSL::BN#mod_add(other, m) -> OpenSSL::BN (3107.0)

(self + other) % m を返します。

...(self + other) % m を返します。

//emlist[][ruby]{
require
'openssl'

Open
SSL::BN.new("7").mod_add(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 4
//}

@param other 和を取る数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー...

OpenSSL::BN#mod_exp(other, m) -> OpenSSL::BN (3107.0)

(self ** other) % m を返します。

...(self ** other) % m を返します。

//emlist[][ruby]{
require
'openssl'

Open
SSL::BN.new("7").mod_exp(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 1
//}

@param other 指数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー...

OpenSSL::BN#mod_inverse(m) -> OpenSSL::BN (3107.0)

自身の mod m における逆元を返します。

...(self * r) % m == 1 となる r を返します。
存在しない場合は例外 OpenSSL::BNError が発生します。

//emlist[][ruby]{
require
'openssl'

p 3.to_bn.mod_inverse(5) # => 2
p (3 * 2) % 5 # => 1
//}

@param m mod を取る数
@raise OpenSSL::BNError 計算時エラー...
<< 1 2 3 ... > >>