るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

Pathname#sub(pattern) {|matched| ... } -> Pathname (21255.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...するパス文字列に対して sub メソッドを呼び出し、その結果を内
容とする新しい Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置...
...き換える文字列を指定します。

//emlist[例][ruby]{
require
'pathname'

path1 = Pathname('/usr/bin/perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

Pathname#sub(pattern, replace) -> Pathname (21255.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...するパス文字列に対して sub メソッドを呼び出し、その結果を内
容とする新しい Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置...
...き換える文字列を指定します。

//emlist[例][ruby]{
require
'pathname'

path1 = Pathname('/usr/bin/perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

Pathname#sub_ext(replace) -> Pathname (12250.0)

拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。

...Pathname オブジェクトを返します。

自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。

@param replace 拡張子を文字列で指定します。

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

Pathname('/usr/bin/shutdown').sub_ext('.rb...
...<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/test..pdf>
Pathna...
...me('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Pathname('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}...

Net::HTTPHeader#sub_type -> String|nil (12220.0)

"text/html" における "html" のようなサブタイプを表す 文字列を返します。

..."text/html" における "html" のようなサブタイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP...
....get_response(uri)
res.sub_type # => "html"
//}...

Set#proper_subset?(set) -> bool (12213.0)

self が集合 set の部分集合である場合に true を返します。

...self が集合 set の部分集合である場合に true を返します。

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

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

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

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

@see Set#superset?...

絞り込み条件を変える

Set#subset?(set) -> bool (12213.0)

self が集合 set の部分集合である場合に true を返します。

...self が集合 set の部分集合である場合に true を返します。

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

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

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

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

@see Set#superset?...

Set#subtract(enum) -> self (12213.0)

元の集合から、enum で与えられた要素を削除します。

...対象の要素を格納したオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
require
'set'
set = Set[10, 20, 40]
set.subtract([10, 20, 30])
p set # => #<Set: {40}>
//}...

OpenSSL::BN#mod_sub(other, m) -> OpenSSL::BN (6220.0)

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

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

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

OpenSSL::BN.new("27").mod_sub(OpenSSL::BN.new("3"), OpenSSL::BN.new("5")) # => 4
//}

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

Resolv::DNS::Name#subdomain_of?(other) -> bool (6213.0)

other が self のサブドメインであるかどうかを返します。

...other が self のサブドメインであるかどうかを返します。

//emlist[][ruby]{
require
"resolv"
domain = Resolv::DNS::Name.create("y.z")
p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
p Resolv::D...
...NS::Name.create("y.z").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("z").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("x.y.z.").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("w.z").subdomain_of?(domain) #=> false
//}...