るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Integer#ord -> Integer (18132.0)

自身を返します。

...自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@see String#ord...

String#ord -> Integer (18114.0)

文字列の最初の文字の文字コードを整数で返します。

...の文字コードを整数で返します。

self が空文字列のときは例外を発生します。

@return 文字コードを表す整数
@raise ArgumentError self の長さが 0 のとき発生

//emlist[例][ruby]{
p "a".ord # => 97
//}

@see Integer#chr, String#chr...

Module#ruby2_keywords(method_name, ...) -> nil (12232.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...s, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument...
...explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions bef...
...ility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[例][ruby]{
module Mod
def foo(meth,...

Proc#ruby2_keywords -> proc (12232.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked...
...e explicit keywords or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.

This should only be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby versions befo...
...atibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
proc will change so that it does not pass through keywords.

//emlist[][ruby]{
module Mod
foo = ->(meth, *a...

OptionParser#order!(argv = self.default_argv) -> [String] (6113.0)

与えられた argv を順番に破壊的にパースします。 argv からオプションがすべて取り除かれます。 argv を返します。

...ParseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["somefile", "-b"]...

絞り込み条件を変える

OptionParser#order!(argv = self.default_argv) {|s| ...} -> [String] (6113.0)

与えられた argv を順番に破壊的にパースします。 argv からオプションがすべて取り除かれます。 argv を返します。

...ParseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["somefile", "-b"]...

OptionParser#order!(argv = self.default_argv, into: nil) -> [String] (6113.0)

与えられた argv を順番に破壊的にパースします。 argv からオプションがすべて取り除かれます。 argv を返します。

...ParseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["somefile", "-b"]...

OptionParser#order!(argv = self.default_argv, into: nil) {|s| ...} -> [String] (6113.0)

与えられた argv を順番に破壊的にパースします。 argv からオプションがすべて取り除かれます。 argv を返します。

...ParseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["somefile", "-b"]...

OptionParser#order(*args) -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

OptionParser#order(*args) {|s| ...} -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

絞り込み条件を変える

OptionParser#order(*args, into: nil) -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

OptionParser#order(*args, into: nil) {|s| ...} -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

OptionParser#order(argv) -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

OptionParser#order(argv) {|s| ...} -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

OptionParser#order(argv, into: nil) -> [String] (6113.0)

与えられた argv を順番にパースします。 オプションではないコマンドの引数(下の例で言うと somefile)に出会うと、パースを中断します。 argv からオプションを取り除いたものを返します。

...サブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b') {|v| p :b }

opt.order(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
["-a", "foo", "somefile", "-b"]...

絞り込み条件を変える

<< 1 2 3 > >>