るりまサーチ

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

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix rank_e
  4. matrix det_e
  5. open3 capture2e

クラス

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Gem::Specification#required_ruby_version=(requirement) (12318.0)

この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。

...この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。

@param requirement Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。

@see Gem::Requirement...

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.

...he 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...
...ment 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 met...
...er methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
be...

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.

...rks 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 wit...
...a special flag such that if it is the final
e
lement 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...
...be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the proc re...

CSV#converters -> Array (12207.0)

現在の変換器のリストを返します。

...在の変換器のリストを返します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", converters: CSV::Converters.keys)
csv.converters # => [:integer, :float, :integer, :float, :date, :date_time, :date_time, :integer, :float]
//}

@see CSV::Converters...

Set#proper_superset?(set) -> bool (12207.0)

self が集合 set の上位集合 (スーパーセット) である場合に true を 返します。

...elf が集合 set の上位集合 (スーパーセット) である場合に true
返します。

superset? は、2 つの集合が等しい場合にも true となります。

proper_superset? は、2 つの集合が等しい場合には false を返します。

@param set 比較対象の Se...
...ise ArgumentError 引数が Set オブジェクトでない場合に発生します。

//emlist[][ruby]{
require 'set'
s = Set[1, 2, 3]
p s.superset?(Set[1, 2]) # => true
p s.superset?(Set[1, 4]) # => false
p s.superset?(Set[1, 2, 3]) # => true
p s.proper_superset?(Set...
...[1, 2]) # => true
p s.proper_superset?(Set[1, 4]) # => false
p s.proper_superset?(Set[1, 2, 3]) # => false
//}

@see Set#subset?...
...
@raise ArgumentError 引数が Set オブジェクトでない場合に発生します。

//emlist[][ruby]{
s = Set[1, 2, 3]
p s.superset?(Set[1, 2]) # => true
p s.superset?(Set[1, 4]) # => false
p s.superset?(Set[1, 2, 3]) # => true
p s.proper_superset?(Set[1, 2])...
...# => true
p s.proper_superset?(Set[1, 4]) # => false
p s.proper_superset?(Set[1, 2, 3]) # => false
//}

@see Set#subset?...

絞り込み条件を変える

REXML::Element#delete_element(element) -> REXML::Element (9407.0)

子要素を削除します。

...を削除します。

e
lement で削除する要素を指定できます。整数、文字列、REXML::Element
オブジェクトのいずれかが指定できます。

REXML::Element を指定すると、その要素が削除されます。
整数を指定すると、element 番目の要素を削...
...されます。

@param element 削除する要素
@see REXML::Elements#delete

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/><d/><c/></a>'
doc.delete_element("/a/b")
doc.to_s # => "<a><c/><c id='1'/><d/><c/></a>"
doc.delete_element("a/c[@id='1']")
doc.t...
...o_s # => "<a><c/><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/></a>"
doc.root.delete_element(1)
doc.to_s # => "<a/>"
//}...

Numeric#coerce(other) -> [Numeric] (9313.0)

自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。

...自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。

デフォルトでは self と other を Float に変換して [other, self] という配列にして返します。
Numeric のサブクラスは、このメソ...
...erce のソースです。other が自身の知らない数値クラスであった場合、
super を呼んでいることに注意して下さい。


//emlist[例][ruby]{
# lib/rational.rb より

def coerce(other)
if other.kind_of?(Float)
return other, self.to_f
e
lsif other.kind_of?(Inte...
...ger)
return Rational.new!(other, 1), self
e
lse
super
e
nd
e
nd
//}

数値クラスの算術演算子は通常自分と演算できないクラスをオペランドとして受け
取ると coerce を使って自分とオペランドを変換した上で演算を行います。
以下は R...

Net::HTTPHeader#content_length=(len) (9307.0)

Content-Length: ヘッダフィールドに値を設定します。

...ntent-Length: ヘッダフィールドに値を設定します。

len に nil を与えると Content-Length: ヘッダフィールドを
削除します。

@param len 設定する値を整数で与えます。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index...
....html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10 # => 10
req.content_length # => 10
//}...

Object#singleton_method(name) -> Method (9307.0)

オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。

...name をオブジェクト化した Method オブ
ジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
class Demo
def in...
...e(n)
@iv = n
e
nd
def hello()
"Hello, @iv = #{@iv}"
e
nd
e
nd

k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}"
e
nd
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}

@see Module#instance...
..._method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method...

OptionParser#environment(env) -> [String] (9307.0)

環境変数 env に対して Shellwords.#shellwords を呼 んで配列にしてから parse を行ないます。

... env に対して
Shellwords.#shellwords を呼
んで配列にしてから parse を行ないます。

@param env 環境変数名を文字列で与えます。

@raise OptionParser::ParseError パースに失敗した場合、発生します。
実際は OptionParse...
...arseError のサブク
ラスになります。

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

config = {}
opts = OptionParser.new
opts.on("-r", "--require LIBRARY"){|lib| config[:lib] = lib }

# HOGE_OPT は hoge というプログラム名に対応した名前です
E
NV[...
...'HOGE_OPT'] = %q{--require lib1 'remain data'}
p opts.environment('HOGE_OPT') # => ["remain data"]
p config # => {:lib=>"lib1"}
//}...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>