ライブラリ
- ビルトイン (6)
- date (1)
-
fiddle
/ import (1) - json (1)
- pathname (29)
-
rexml
/ document (6) - socket (2)
-
webrick
/ httputils (1)
クラス
- Date (1)
-
Enumerator
:: Lazy (2) - MatchData (1)
- Pathname (29)
-
REXML
:: CData (2) -
REXML
:: Declaration (1) -
REXML
:: Element (1) -
REXML
:: Elements (1) -
REXML
:: NotationDecl (1) -
Socket
:: Option (2) - Symbol (1)
-
Thread
:: Backtrace :: Location (2) -
WEBrick
:: HTTPUtils :: FormData (1)
モジュール
キーワード
-
add
_ element (1) - bind (1)
- binread (1)
- blockdev? (1)
- chardev? (1)
- chmod (1)
- data (1)
-
delete
_ all (1) - directory? (1)
- dirname (1)
- find (2)
- grep (1)
-
grep
_ v (1) - grpowned? (1)
- inspect (1)
- lchmod (1)
-
make
_ link (1) -
make
_ symlink (1) - match (1)
- mkdir (1)
- open (2)
- opendir (2)
- owned? (1)
- read (1)
- readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- rmdir (1)
- setgid? (1)
- setuid? (1)
-
to
_ json (1) - value (1)
-
world
_ readable? (1) -
world
_ writable? (1)
検索結果
先頭5件
-
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...