るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. csv values_at

検索結果

MatchData#to_s -> String (81625.0)

マッチした文字列全体を返します。

マッチした文字列全体を返します。

//emlist[例][ruby]{
/bar/ =~ "foobarbaz"
p $~ # => #<MatchData:0x401b1be4>
p $~.to_s # => "bar"
//}

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

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

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

//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|
puts call.to_s
end

# => path/to/foo.rb:5:in `initialize'
# path/to/foo...

REXML::Declaration#to_s -> String (81607.0)

ノードを文字列化します。

ノードを文字列化します。

REXML::NotationDecl#to_s -> String (81607.0)

self を文字列化したものを返します。

self を文字列化したものを返します。

Date#to_s -> String (72655.0)

8601 書式の文字列を返します (拡大表記 ('%Y-%m-%d') を使います)。

8601 書式の文字列を返します (拡大表記 ('%Y-%m-%d') を使います)。

絞り込み条件を変える

REXML::CData#to_s -> String (72625.0)

テキスト文字列を返します。

テキスト文字列を返します。

@see REXML::Text#value, REXML::Text#to_s

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}

Socket::Option#to_s -> String (72625.0)

オプションのデータ(内容)を文字列で返します。

オプションのデータ(内容)を文字列で返します。

内容が整数や真偽値、もしくは struct linger であることがわかっている場合には、
Socket::Option#int, Socket::Option#bool, Socket::Option#linger
を用いて

to_s は過去との互換性のために存在します。

WEBrick::HTTPUtils::FormData#to_s -> String (72607.0)

自身が表すフォームデータのうちのひとつを文字列として返します。

自身が表すフォームデータのうちのひとつを文字列として返します。

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (64252.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

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

path = Pathname("testfile")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_path # => #<Pathname:/path/to/testfile>
path.e...

Pathname#dirname -> Pathname (55252.0)

Pathname.new(File.dirname(self.to_s)) と同じです。

Pathname.new(File.dirname(self.to_s)) と同じです。

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

Pathname('/usr/bin/shutdown').dirname # => #<Pathname:/usr/bin>
//}

@see File.dirname

絞り込み条件を変える

REXML::Element#add_element(element, attrs = nil) -> Element (46558.0)

子要素を追加します。

子要素を追加します。

element として追加する要素を指定します。
REXML::Element オブジェクトもしくは文字列を指定します。

element として REXML::Element オブジェクトを指定した場合、それが追加されます。
文字列を指定した場合は、それを要素名とする要素を追加します。

attrs に { String => String } という Hash を渡すと、
追加する要素の属性を指定できます。

子要素の最後に追加されます。

返り値は追加された要素です。

@param element 追加する要素
@param attrs 追加する要素に設定する...

Pathname#opendir -> Dir (45952.0)

Dir.open(self.to_s, &block) と同じです。

Dir.open(self.to_s, &block) と同じです。


@see Dir.open

Pathname#opendir {|dir| ... } -> nil (45952.0)

Dir.open(self.to_s, &block) と同じです。

Dir.open(self.to_s, &block) と同じです。


@see Dir.open

Pathname#readlink -> Pathname (45952.0)

Pathname.new(File.readlink(self.to_s)) と同じです。

Pathname.new(File.readlink(self.to_s)) と同じです。


@see File.readlink

Socket::Option#data -> String (45925.0)

オプションのデータ(内容)を文字列で返します。

オプションのデータ(内容)を文字列で返します。

内容が整数や真偽値、もしくは struct linger であることがわかっている場合には、
Socket::Option#int, Socket::Option#bool, Socket::Option#linger
を用いて

to_s は過去との互換性のために存在します。

絞り込み条件を変える

Pathname#find(ignore_error: true) -> Enumerator (45922.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

ブロックを省略した場合は Enumerator を返します。

@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。

@see Find.#find

Pathname#find(ignore_error: true) {|pathname| ...} -> nil (45922.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

ブロックを省略した場合は Enumerator を返します。

@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。

@see Find.#find

Pathname#binread(*args) -> String | nil (45670.0)

IO.binread(self.to_s, *args)と同じです。

IO.binread(self.to_s, *args)と同じです。

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

pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(20, 10) # => ...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (45652.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby...

Pathname#grpowned? -> bool (45652.0)

FileTest.grpowned?(self.to_s) と同じです。

FileTest.grpowned?(self.to_s) と同じです。


@see FileTest.#grpowned?

絞り込み条件を変える

Pathname#owned? -> bool (45652.0)

FileTest.owned?(self.to_s) と同じです。

FileTest.owned?(self.to_s) と同じです。


@see FileTest.#owned?

Pathname#readlines(*args) -> [String] (45652.0)

IO.readlines(self.to_s, *args)と同じです。

IO.readlines(self.to_s, *args)と同じです。


@see IO.readlines

Fiddle::Importer#bind(signature, *opts) { ... } -> Fiddle::Function (36940.0)

Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。

Ruby のブロックを C の関数で wrap し、その関数をモジュールに
インポートします。

これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。

signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。

opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示することができます。

@return インポートした関数を表す ...

Pathname#chmod(mode) -> Integer (36652.0)

File.chmod(mode, self.to_s) と同じです。

File.chmod(mode, self.to_s) と同じです。

@param mode ファイルのアクセス権限を整数で指定します。


@see File.chmod

Pathname#lchmod(mode) -> Integer (36652.0)

File.lchmod(mode, self.to_s) と同じです。

File.lchmod(mode, self.to_s) と同じです。

@param mode ファイルのアクセス権限を整数で指定します。


@see File.lchmod

絞り込み条件を変える

Pathname#read(*args) -> String | nil (36652.0)

IO.read(self.to_s, *args)と同じです。

IO.read(self.to_s, *args)と同じです。


@see IO.read

Pathname#blockdev? -> bool (36352.0)

FileTest.blockdev?(self.to_s) と同じです。

FileTest.blockdev?(self.to_s) と同じです。


@see FileTest.#blockdev?

Pathname#chardev? -> bool (36352.0)

FileTest.chardev?(self.to_s) と同じです。

FileTest.chardev?(self.to_s) と同じです。


@see FileTest.#chardev?

Pathname#directory? -> bool (36352.0)

FileTest.directory?(self.to_s) と同じです。

FileTest.directory?(self.to_s) と同じです。


@see FileTest.#directory?

Pathname#mkdir(*args) -> 0 (36352.0)

Dir.mkdir(self.to_s, *args) と同じです。

Dir.mkdir(self.to_s, *args) と同じです。


@see Dir.mkdir

絞り込み条件を変える

Pathname#readable? -> bool (36352.0)

FileTest.readable?(self.to_s) と同じです。

FileTest.readable?(self.to_s) と同じです。


@see FileTest.#readable?

Pathname#readable_real? -> bool (36352.0)

FileTest.readable_real?(self.to_s) と同じです。

FileTest.readable_real?(self.to_s) と同じです。


@see FileTest.#readable_real?

Pathname#rmdir -> 0 (36352.0)

Dir.rmdir(self.to_s) と同じです。

Dir.rmdir(self.to_s) と同じです。


@see Dir.rmdir

Pathname#setgid? -> bool (36352.0)

FileTest.setgid?(self.to_s) と同じです。

FileTest.setgid?(self.to_s) と同じです。


@see FileTest.#setgid?

Pathname#setuid? -> bool (36352.0)

FileTest.setuid?(self.to_s) と同じです。

FileTest.setuid?(self.to_s) と同じです。


@see FileTest.#setuid?

絞り込み条件を変える

Pathname#world_readable? -> bool (36352.0)

FileTest.world_readable?(self.to_s) と同じです。

FileTest.world_readable?(self.to_s) と同じです。


@see FileTest.#world_readable?

Pathname#world_writable? -> bool (36352.0)

FileTest.world_writable?(self.to_s) と同じです。

FileTest.world_writable?(self.to_s) と同じです。


@see FileTest.#world_writable?

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

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

Thread::Backtrace::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|
puts call.inspect
end

# => "path/to/foo.rb:5:in ...

REXML::Elements#delete_all(xpath) -> [REXML::Element] (27922.0)

xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。

xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。

@param xpath 取り除く要素を指し示す XPath 文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><c/><c/><c/><c/></a>')
doc.elements.delete_all("a/c") # => [<c/>, <c/>, <c/>, <c/>]
doc.to_s # => "<a/>"
//}

Pathname#make_link(old) -> 0 (27652.0)

File.link(old, self.to_s) と同じです。

File.link(old, self.to_s) と同じです。


@see File.link

絞り込み条件を変える

Pathname#make_symlink(old) -> 0 (27652.0)

File.symlink(old, self.to_s) と同じです。

File.symlink(old, self.to_s) と同じです。


@see File.symlink

Pathname#open(mode = &#39;r&#39;, perm = 0666) -> File (27652.0)

File.open(self.to_s, *args, &block) と同じです。

File.open(self.to_s, *args, &block) と同じです。


@see File.open

Pathname#open(mode = &#39;r&#39;, perm = 0666) {|file| ... } -> object (27652.0)

File.open(self.to_s, *args, &block) と同じです。

File.open(self.to_s, *args, &block) と同じです。


@see File.open

REXML::CData#value -> String (27325.0)

テキスト文字列を返します。

テキスト文字列を返します。

@see REXML::Text#value, REXML::Text#to_s

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}

Symbol#match(other) -> MatchData | nil (19522.0)

正規表現 other とのマッチを行います。

正規表現 other とのマッチを行います。

(self.to_s.match(other) と同じです。)

@param other 比較対象のシンボルを指定します。

@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。

p :foo.match(/foo/) # => #<MatchData "foo">
p :foobar.match(/bar/) # => #<MatchData "bar">
p :foo.match(/bar/) # => nil

@see String#match
@see...

絞り込み条件を変える

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

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

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/)....

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

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

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/).t...