るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< 1 2 > >>

Rake::InvocationChain::EmptyInvocationChain#to_s -> String (99607.0)

'TOP' という文字列を返します。

'TOP' という文字列を返します。

MatchData#to_s -> String (90625.0)

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

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

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

Rational#to_s -> String (81679.0)

自身を人間が読みやすい形の文字列表現にして返します。

自身を人間が読みやすい形の文字列表現にして返します。

"3/5", "-17/7" のように10進数の表記を返します。

@return 有理数の表記にした文字列を返します。

//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}

@see Rational#inspect

Process::Status#to_s -> String (81655.0)

to_i.to_s と同じです。

to_i.to_s と同じです。

Matrix#to_s -> String (81625.0)

行列を文字列化し、その文字列を返します。

行列を文字列化し、その文字列を返します。

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2]
a2 = [3, 4.5]
m = Matrix[a1, a2]

p m.to_s # => "Matrix[[1, 2], [3, 4.5]]"
//}

絞り込み条件を変える

REXML::CData#to_s -> String (81625.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"
//}

Rake::InvocationChain#to_s -> String (81625.0)

トップレベルのタスクから自身までの依存関係を文字列として返します。

トップレベルのタスクから自身までの依存関係を文字列として返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.to_s # => "TOP => task_a"
end
//}

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

Date#to_s -> String (81607.0)

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

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

Gem::Platform#to_s -> String (81607.0)

自身にセットされている CPU, OS, バージョンを文字列として返します。

自身にセットされている CPU, OS, バージョンを文字列として返します。

絞り込み条件を変える

Pathname#to_s -> String (81607.0)

パス名を文字列で返します。

パス名を文字列で返します。


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

path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}

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

正規化された属性値を返します。

正規化された属性値を返します。

属性値の正規化については XML の仕様を参考にしてください。

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

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

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

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

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

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

Scanf::FormatSpecifier#to_s (81607.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatString#to_s (81607.0)

@todo

@todo

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

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

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

Float#to_s -> String (72715.0)

自身を人間が読みやすい形の文字列表現にして返します。

自身を人間が読みやすい形の文字列表現にして返します。

固定小数点、浮動小数点の形式か、 "Infinity"、"-Infinity"、"NaN" のいず
れかを返します。

@return 文字列を返します。

//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
...

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

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

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

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

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

OpenSSL::X509::Certificate#to_s -> String (72607.0)

PEM 形式の文字列を返します。

PEM 形式の文字列を返します。

絞り込み条件を変える

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (55252.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#to_path -> String (54670.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s

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

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

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

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

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

//emlist[例][ruby...

Pathname#mkpath -> nil (54652.0)

FileUtils.mkpath(self.to_s) と同じです。

FileUtils.mkpath(self.to_s) と同じです。


@see FileUtils.#mkpath

Pathname#lstat -> File::Stat (46252.0)

File.lstat(self.to_s) と同じです。

File.lstat(self.to_s) と同じです。


@see File.lstat

絞り込み条件を変える

Pathname#stat -> File::Stat (46252.0)

File.stat(self.to_s) と同じです。

File.stat(self.to_s) と同じです。


@see File.stat

Float#prev_float -> Float (46222.0)

浮動小数点数で表現可能な self の前の値を返します。

浮動小数点数で表現可能な self の前の値を返します。

(-Float::MAX).prev_float と (-Float::INFINITY).prev_float
は -Float::INFINITY を返します。Float::NAN.prev_float は
Float::NAN を返します。

//emlist[例][ruby]{
p 0.01.prev_float # => 0.009999999999999998
p 1.0.prev_float # => 0.9999999999999999
p 100.0.prev_float # => 99.9999999999...

Pathname#atime -> Time (45952.0)

File.atime(self.to_s) を渡したものと同じです。

File.atime(self.to_s) を渡したものと同じです。

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

pathname = Pathname("testfile")
pathname.atime # => 2018-12-18 20:58:13 +0900
//}

@see File.atime

Pathname#fnmatch(pattern, *args) -> bool (45952.0)

File.fnmatch(pattern, self.to_s, *args) と同じです。

File.fnmatch(pattern, self.to_s, *args) と同じです。

@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

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

path = Pathname("testfile")
path.fnmatch("test*") ...

Pathname#fnmatch?(pattern, *args) -> bool (45952.0)

File.fnmatch?(pattern, self.to_s, *args) と同じです。

File.fnmatch?(pattern, self.to_s, *args) と同じです。

@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

@see File.fnmatch?

絞り込み条件を変える

Float#next_float -> Float (45922.0)

浮動小数点数で表現可能な self の次の値を返します。

浮動小数点数で表現可能な self の次の値を返します。

Float::MAX.next_float、Float::INFINITY.next_float は
Float::INFINITY を返します。Float::NAN.next_float は
Float::NAN を返します。

//emlist[例][ruby]{
p 0.01.next_float # => 0.010000000000000002
p 1.0.next_float # => 1.0000000000000002
p 100.0.next_float # => 100.00000000000001

p ...

Pathname#truncate(length) -> 0 (45652.0)

File.truncate(self.to_s, length) と同じです。

File.truncate(self.to_s, length) と同じです。


@param length 変更したいサイズを整数で与えます。

@see File.truncate

REXML::Attribute#to_string -> String (45604.0)

"name='value'" という形式の文字列を返します。

"name='value'" という形式の文字列を返します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}

Symbol#match(other) -> MatchData | nil (37522.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...

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

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

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

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

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

絞り込み条件を変える

WEBrick::BasicLog#fatal(msg) -> () (36622.0)

ログレベル FATAL で文字列 msg をログに記録します。

ログレベル FATAL で文字列 msg をログに記録します。

行頭に level を表す文字列が追加されます。
msg の終端が "\n" でない場合には "\n" を追加します。

@param msg 記録したい文字列を指定します。文字列でない場合は to_s メソッドで文字列に変換します。

require 'webrick'
logger = WEBrick::BasicLog.new()
logger.fatal('out of money') #=> FATAL out of money (標準エラー出力に出力)

Pathname#birthtime -> Time (36352.0)

File.birthtime(self.to_s) を渡したものと同じです。

File.birthtime(self.to_s) を渡したものと同じです。

@raise NotImplementedError Windows のような birthtime のない環境で発生します。


@see File.birthtime

Pathname#utime(atime, mtime) -> Integer (28252.0)

File.utime(atime, mtime, self.to_s) と同じです。

File.utime(atime, mtime, self.to_s) と同じです。

@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。

@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。


@see File.utime

Pathname#binwrite(string, offset=nil) -> Integer (27652.0)

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

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


@see IO.binwrite

Pathname#ctime -> Time (27652.0)

File.ctime(self.to_s) を渡したものと同じです。

File.ctime(self.to_s) を渡したものと同じです。

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

IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}

@see File.ctime

絞り込み条件を変える

Pathname#each_entry {|pathname| ... } -> nil (27652.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。


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

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@...

Pathname#mtime -> Time (27652.0)

File.mtime(self.to_s) を渡したものと同じです。

File.mtime(self.to_s) を渡したものと同じです。


@see File.mtime

Pathname#write(string, offset=nil, **opts) -> Integer (27622.0)

IO.write(self.to_s, string, offset, **opts)と同じです。

@see IO.write

Float#inspect -> String (27415.0)

自身を人間が読みやすい形の文字列表現にして返します。

自身を人間が読みやすい形の文字列表現にして返します。

固定小数点、浮動小数点の形式か、 "Infinity"、"-Infinity"、"NaN" のいず
れかを返します。

@return 文字列を返します。

//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
...

Pathname#empty? -> bool (27400.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'

Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
//}

//emlist[例 ファイルの場合][ruby]{
require "path...

絞り込み条件を変える

Pathname#directory? -> bool (27352.0)

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

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


@see FileTest.#directory?

Pathname#executable? -> bool (27352.0)

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

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


@see FileTest.#executable?

Pathname#executable_real? -> bool (27352.0)

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

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


@see FileTest.#executable_real?

Pathname#exist? -> bool (27352.0)

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

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


@see FileTest.#exist?

Pathname#extname -> String (27352.0)

File.extname(self.to_s) と同じです。

File.extname(self.to_s) と同じです。


@see File.extname

絞り込み条件を変える

Pathname#ftype -> String (27352.0)

File.ftype(self.to_s) と同じです。

File.ftype(self.to_s) と同じです。


@see File.ftype

Pathname#rmtree -> nil (27352.0)

FileUtils.rm_r(self.to_s) と同じです。

FileUtils.rm_r(self.to_s) と同じです。


@see FileUtils.#rm_r

Pathname#setgid? -> bool (27352.0)

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

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


@see FileTest.#setgid?

Pathname#setuid? -> bool (27352.0)

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

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


@see FileTest.#setuid?

Pathname#socket? -> bool (27352.0)

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

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


@see FileTest.#socket?

絞り込み条件を変える

Pathname#split -> Array (27352.0)

File.split(self.to_s) と同じです。

File.split(self.to_s) と同じです。

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

pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}

@see File.split

Pathname#sticky? -> bool (27352.0)

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

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


@see FileTest.#sticky?

Pathname#world_writable? -> bool (27352.0)

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

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


@see FileTest.#world_writable?

Pathname#writable? -> bool (27352.0)

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

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


@see FileTest.#writable?

Pathname#writable_real? -> bool (27352.0)

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

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


@see FileTest.#writable_real?

絞り込み条件を変える

Thread::Backtrace::Location#inspect -> String (27352.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::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"
//}

Rational#inspect -> String (27322.0)

自身を人間が読みやすい形の文字列表現にして返します。

自身を人間が読みやすい形の文字列表現にして返します。

"(3/5)", "(-17/7)" のように10進数の表記を返します。

@return 有理数の表記にした文字列を返します。

//emlist[例][ruby]{
Rational(5, 8).inspect # => "(5/8)"
Rational(2).inspect # => "(2/1)"
Rational(-8, 6).inspect # => "(-4/3)"
Rational(0.5).inspect # => "(1/2)"
//}

@see Rational#to_s

OpenSSL::X509::Certificate#to_pem -> String (27307.0)

PEM 形式の文字列を返します。

PEM 形式の文字列を返します。

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (18940.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 (18940.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...

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

子要素を追加します。

子要素を追加します。

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

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

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

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

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

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

Pathname#basename(suffix = "") -> Pathname (18652.0)

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

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

Pathname("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname("ruby/ruby.c").basename("...

Pathname#dirname -> Pathname (18652.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

Pathname#each_line(*args) -> Enumerator (18652.0)

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

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

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

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\...

絞り込み条件を変える

Pathname#readlink -> Pathname (18652.0)

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

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


@see File.readlink

Hash#transform_values -> Enumerator (18622.0)

すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。

すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。
キーは変化しません。

@return 置き換えたハッシュを返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。

//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", ...

Hash#transform_values! -> Enumerator (18622.0)

すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。 キーは変化しません。

すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。
キーは変化しません。

@return transform_values! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。

//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values!(&:to_s) #=> ...

Pathname#find(ignore_error: true) -> Enumerator (18622.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 (18622.0)

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

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

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

と同じです。

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

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

@see Find.#find

絞り込み条件を変える

REXML::Elements#delete_all(xpath) -> [REXML::Element] (18622.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/>"
//}

String#to_f -> Float (18622.0)

文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。

文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。

浮動小数点数とみなせなくなるところまでを変換対象とします。
途中に変換できないような文字列がある場合、それより先の文字列は無視されます。

//emlist[][ruby]{
p "-10".to_f # => -10.0
p "10e2".to_f # => 1000.0
p "1e-2".to_f # => 0.01
p ".1".to_f # => 0.1

p "1_0_0".to_f # => 100.0 # 数値リテラルと同じように区切りに _ を使える
p " \n10".to_f ...

Pathname#binread(*args) -> String | nil (18352.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) # => ...

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

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

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

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


@see File.chmod

Pathname#chown(owner, group) -> Integer (18352.0)

File.chown(owner, group, self.to_s) と同じです。

File.chown(owner, group, self.to_s) と同じです。

@param owner オーナーを指定します。

@param group グループを指定します。

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

Pathname('testfile').stat.uid # => 501
Pathname('testfile').chown(502, 12)
Pathname('testfile').stat.uid # => 502
//}

@see File.chown, File#chown

絞り込み条件を変える

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

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

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

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


@see File.lchmod

Pathname#lchown(owner, group) -> Integer (18352.0)

File.lchown(owner, group, self.to_s) と同じです。

File.lchown(owner, group, self.to_s) と同じです。

@param owner オーナーを指定します。

@param group グループを指定します。


@see File.lchown

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

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

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


@see File.open

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

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

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


@see IO.read

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

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

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


@see IO.readlines

絞り込み条件を変える

Pathname#rename(to) -> 0 (18352.0)

File.rename(self.to_s, to) と同じです。

File.rename(self.to_s, to) と同じです。

@param to ファイル名を表す文字列を指定します。


@see File.rename

Pathname#size -> Integer (18352.0)

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

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


@see FileTest.#size

Pathname#sysopen(*args) -> Integer (18352.0)

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

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


@see IO.sysopen

Pathname#blockdev? -> bool (18052.0)

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

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


@see FileTest.#blockdev?

Pathname#chardev? -> bool (18052.0)

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

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


@see FileTest.#chardev?

絞り込み条件を変える

Pathname#each_line(*args) {|line| ... } -> nil (18052.0)

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

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

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

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\...

Pathname#file? -> bool (18052.0)

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

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


@see FileTest.#file?

Pathname#grpowned? -> bool (18052.0)

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

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


@see FileTest.#grpowned?

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

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

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


@see File.link

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

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

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


@see File.symlink

絞り込み条件を変える

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

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

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


@see Dir.mkdir

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

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

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


@see File.open

Pathname#opendir -> Dir (18052.0)

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

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


@see Dir.open

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

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

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


@see Dir.open

Pathname#owned? -> bool (18052.0)

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

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


@see FileTest.#owned?

絞り込み条件を変える

<< 1 2 > >>