るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< < ... 23 24 25 >>

NEWS for Ruby 3.0.0 (30.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...single rest argument and no keywords.
16166

//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leadin...
...asses updates

Outstanding ones only.

* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice / Array#[]
*...

xmlrpc (30.0)

XML-RPC を扱うためのライブラリです。

...めのページであり、require 'xmlrpc' を実行しても
エラーになることに注意して下さい。

=== Author and Copyright

Copyright (C) 2001-2004 by Michael Neumann

Released under the same term of license as Ruby.

=== Overview

XMLRPC is a lightweight protocol that enables remo...
...dure calls over
HTTP. It is defined at http://www.xmlrpc.com.

XMLRPC allows you to create simple distributed computing solutions that span
computer languages. Its distinctive feature is its simplicity compared to
other approaches like SOAP and CORBA.

The Ruby standard library package 'xmlrpc' en...
...* Basic HTTP-401 Authentification
* HTTPS protocol (SSL)

* Parsers
* NQXML (NQXMLStreamParser, NQXMLTreeParser)
* Expat (XMLStreamParser, XMLTreeParser)
* REXML (REXMLStreamParser)
* xml-scan (XMLScanStreamParser)
* Fastest parser is Expat's XMLStreamParser!

* Gen...

CMath (18.0)

複素数演算をサポートするモジュールです。

...、「メソッド名!」の形式で呼び出します。

//emlist[例][ruby]{
require "cmath"

# 複素数の範囲の立方根(の主値)= exp(1/3 πi)
CMath.cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)

# 実数の範囲の立方根
Math.cbrt(-1) # => -1.0

i
nclude CMath

# レシ...
...ーバー無しで使える
cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)

# cbrt! は Math.cbrt のエイリアス
cbrt!(-1) # => -1.0
//}...

NEWS for Ruby 2.7.0 (18.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
i
n [a, [b, *c]]
p a #=> 0...
...nd
//}

//emlist[][ruby]{
case {a: 0, b: 1}
i
n {a: 0, x: 1}
:unreachable
i
n {a: 0, b: var}
p var #=> 1
end
//}

//emlist[][ruby]{
case -1
i
n 0 then :unreachable
i
n 1 then :unreachable
end #=> NoMatchingPatternError
//}

//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "n...
...用例:

//emlist{
$ RUBYOPT=-W:no-deprecated ruby -e '$; = //'
//}

* 実験的機能の警告を止める例:

//emlist{
$ ruby -e '0 in a'
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!

$ ruby -W:no-experimental -e '0 in a'
//}

* RUB...

Object#===(other) -> bool (18.0)

case 式で使用されるメソッドです。d:spec/control#case も参照してください。

...トです。

//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===(12), ... が実行される
result =
case age
when 0 .. 2
"baby"
when 3 .. 6
"little child"
when 7 .. 12
"child"
when 13 .. 18
"youth"
else
"adult"
end

puts result #=> "child"

def check arg
ca...
...when /ruby(?!\s*on\s*rails)/i
"hit! #{arg}"
when String
"Instance of String class. But don't hit."
else
"unknown"
end
end

puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's wo...

絞り込み条件を変える

logger (12.0)

ログを記録するためのライブラリです。

...ラー
: FATAL
プログラムをクラッシュさせるような制御不可能なエラー
: ERROR
制御可能なエラー
: WARN
警告
: INFO
一般的な情報
: DEBUG
低レベルの情報

全てのメッセージは必ずログレベルを持ちます。また Logger オブジェ...
...記録されません。

普段は INFO しか記録していないが、デバッグ情報が必要になった時には、
Logger オブジェクトのログレベルを DEBUG に下げるなどという使い方をします。

==== 例

//emlist[][ruby]{
require 'logger'
logger = Logger.new(STD...
...)
logger.info("Program started")
logger.warn("Nothing to do!")

path = "a_non_existent_file"

begin
File.foreach(path) do |line|
unless line =~ /^(\w+) = (.*)$/
logger.error("Line in wrong format: #{line.chomp}")
end
end
rescue => err
logger.fatal("Caught exception; exiting")
l...
<< < ... 23 24 25 >>