るりまサーチ

最速Rubyリファレンスマニュアル検索!
80件ヒット [1-80件を表示] (0.038秒)
トップページ > クエリ:map[x] > クエリ:to_s[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

検索結果

Thread::Backtrace::Location#to_s -> String (18113.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end

# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...

1.6.8から1.8.0への変更点(まとめ) (90.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...yield の戻り値になります。

: to_str [compat]

to_s
tr を定義したオブジェクトはより広範囲にStringとして振舞うように
なりました。

文字列を引数に取るほとんどの組み込みメソッドは、to_str による暗黙の
型変換を試...
...: ((<Range#include?|Range/include?>)) [new]
: ((<Range#member?|Range/member?>)) [new]
追加

=== Regexp

: ((<Regexp#to_s|Regexp/to_s>)) [new]

追加。((<ruby-dev:16909>))

これにより、
re1 = /hogehoge/i
re2 = /fugafuga/
re3 = / #{re1} | #{re2} /...
...ll("KILL", pid) とは
できないようです・・・2002-08-28 その後 "KILL" で指定できるようになっ
たようです)

: win32: map OS error to errno. [change]

: cygwin

cygwinでは常にバイナリモードになりました(((<ruby-dev:19583>)))

: ((<File/File.dirname>))...

NEWS for Ruby 2.7.0 (90.0)

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

...がデフォルトのブロックの仮引数として
導入されました。 4475

//emlist[][ruby]{
[1, 2, 10].map { _1.to_s(16) } #=> ["1", "2", "a"]
[[1, 2], [3, 4]].map { _1 + _2 } #=> [3, 7]
//}

* 「_1」などはまだローカル変数名として使えて、ローカル変数...
...Enumerable
* 新規メソッド
* Enumerable#filter_mapが追加されました。 15323
* Enumerable#tallyが追加されました。 11076
//emlist[Enumerable#filter_map][ruby]{
[1, 2, 3].filter_map {|x| x.odd? ? x.to_s : nil } #=> ["1", "3"]
//}
//emlist[Enumerable#tally][ruby]{...
...(&:tuesday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
p e.class #=> Enumerator
p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
//}
//emlist[Enumerator::Lazy#with_index][ruby]{
("a".....

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (30.0)

Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。

...ます。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333",...

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (30.0)

Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。

...します。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104",...

絞り込み条件を変える

Thread::Backtrace::Location (24.0)

Ruby のフレームを表すクラスです。

...1][ruby]{
# caller_locations.rb
def a(skip)
caller_locations(skip)
end
def b(skip)
a(skip)
end
def c(skip)
b(skip)
end

c(0..2).map do |call|
puts call.to_s
end
//}

例1の実行結果:

caller_locations.rb:2:in `a'
caller_locations.rb:5:in `b'
caller_locations.rb:8:in `c'

//emlist[...
...class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}

例2の実行結果:

init.rb:4:in `initialize'
init.rb:8:in `new'
init.rb:8:in `<main>'

=== 参考

* Ruby VM アド...

Thread::Backtrace::Location#inspect -> String (22.0)

Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...:Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call...

REXML::ExternalEntity (12.0)

DTD 内の宣言でパラメータ実体参照を使って宣言が されているものを表わすクラスです。

...doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE xhtml [
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
EOS

p doctype.children.find_all{|child| REXML::ExternalEntity === child }.map(&:to_s)
# => ["%HTMLsymbol;"]
//}...