るりまサーチ

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

別のキーワード

  1. _builtin argumenterror
  2. on argumenterror
  3. new argumenterror
  4. dump argumenterror
  5. parse argumenterror

検索結果

<< < 1 2 3 > >>

URI.decode_www_form(str, enc=Encoding::UTF_8) -> [[String, String]] (24.0)

文字列から URL-encoded form data をデコードします。

...'], ['b', '3']]
p ary.assoc('a').last #=> '1'
p ary.assoc('b').last #=> '3'
p ary.rassoc('a').last #=> '2'
p Hash[ary] # => {"a"=>"2", "b"=>"3"}

@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正...

NEWS for Ruby 3.0.0 (18.0)

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

...eyword arguments are now separated from 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 mat...
...zen? # => true
//}

* EXPERIMENTAL: Hash#each consistently yields a 2-element array. 12706
* Now `{ a: 1 }.each(&->(k, v) { })` raises an ArgumentError due to lambda's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413...
...verrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_match. 17030
* Requiring 'open-uri' no longer redefines `Kernel#open`. Call `URI.open` directly or `use URI#open` instead. 15893
* SortedSet ha...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO (18.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...了時に StringIO は close されます。nil を返します。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts sio.read

OpenURI.open_uri('http://www.example.com'){|sio| sio.read }

options には Hash を与えます。理解するハッ...
...、3番目にはプロクシのパスワードを指定します。

:proxy と :proxy_http_basic_authentication を同時に指定すると
ArgumentError
が発生します。

使い方:
//emlist{
:proxy_http_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "prox...
...リソースの取得に失敗した時に
Net::FTPError のサブクラスが発生します。詳しくは net/ftp
を参照して下さい。

@raise ArgumentError 与えられた mode が読み込みモードでなかった場合に発生します。...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) {|sio| ... } -> nil (18.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...了時に StringIO は close されます。nil を返します。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts sio.read

OpenURI.open_uri('http://www.example.com'){|sio| sio.read }

options には Hash を与えます。理解するハッ...
...、3番目にはプロクシのパスワードを指定します。

:proxy と :proxy_http_basic_authentication を同時に指定すると
ArgumentError
が発生します。

使い方:
//emlist{
:proxy_http_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "prox...
...リソースの取得に失敗した時に
Net::FTPError のサブクラスが発生します。詳しくは net/ftp
を参照して下さい。

@raise ArgumentError 与えられた mode が読み込みモードでなかった場合に発生します。...

Range#end -> object (17.0)

終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま せん。

...終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま
せん。

//emlist[例][ruby]{
(10..20).last # => 20
(10...20).last # => 20
//}

@see Range#begin...

絞り込み条件を変える

Array#first(n) -> Array (13.0)

先頭の n 要素を配列で返します。n は 0 以上でなければなりません。

...指定した場合に発生します。

@raise ArgumentError n が負値の場合発生します。

//emlist[例][ruby]{
ary = [0, 1, 2]
p ary.first(0)
p ary.first(1)
p ary.first(2)
p ary.first(3)
p ary.first(4)
# => []
# [0]
# [0, 1]
# [0, 1, 2]
# [0, 1, 2]
//}

@see Array#last...

NEWS for Ruby 2.5.0 (12.0)

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

...s の精度を改良しました 11952
* Process.last_status を追加。$? と同じです 14043

* Range
* Range.new no longer hides exceptions when comparing begin and
end with #<=> and raise a "bad value for range" ArgumentError
but instead lets the exception from the #<=>...

Range#first(n) -> [object] (12.0)

最初の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。

...に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
(10..20).first(3) # => [10, 11, 12]
//}

@see Range#last, 12697...

クラス/メソッドの定義 (12.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...ef foo(x, y = 1) # 2番目の引数yにデフォルト値を指定
10 * x + y
end
p foo(1, 5) #=> 15
p foo(3) #=> 31
p foo #=> ArgumentError (wrong number of arguments)
//}

デフォルト値を指定する引数の位置は、1つの連続した区間になっている必要があ...
...ソッド定義式やinstance_eval)でのみ呼び出せ
ます。

//emlist[例: protected の可視性][ruby]{
class Foo
def foo
p caller.last
end
protected :foo
end

obj = Foo.new

# そのままでは呼べない
obj.foo rescue nil # => -:11 - protected method `foo' called for #<F...

Array#first -> object | nil (8.0)

配列の先頭の要素を返します。要素がなければ nil を返します。

...配列の先頭の要素を返します。要素がなければ nil を返します。

//emlist[例][ruby]{
p [0, 1, 2].first #=> 0
p [].first #=> nil
//}

@see Array#last...

絞り込み条件を変える

Range#begin -> object (2.0)

始端の要素を返します。 始端を持たない範囲オブジェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

始端の要素を返します。
始端を持たない範囲オブジェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。

//emlist[例][ruby]{
# 始端を持つ場合
p (1..5).begin # => 1
p (1..0).begin # => 1
p (1..5).first # => 1
p (1..0).first # => 1

# 始端を持たない場合
p (..5).begin #=> nil
p (..5).first #=> RangeError
//}

@see Range#end
<< < 1 2 3 > >>