1589件ヒット
[1-100件を表示]
(0.202秒)
別のキーワード
ライブラリ
- ビルトイン (896)
- bigdecimal (24)
- csv (48)
- digest (24)
- erb (12)
-
fiddle
/ import (12) - json (12)
- matrix (24)
- openssl (12)
- optparse (24)
- ostruct (14)
- pathname (123)
- rake (24)
-
rexml
/ document (252) -
rubygems
/ requirement (12) -
rubygems
/ version (24) - set (28)
- stringio (12)
- win32ole (12)
クラス
- Array (62)
- BasicObject (12)
- BigDecimal (24)
-
CSV
:: Row (24) -
CSV
:: Table (24) - Complex (12)
- Data (6)
-
Digest
:: Base (24) - ERB (12)
- Encoding (24)
-
Enumerator
:: Lazy (22) - Exception (24)
- FalseClass (24)
- Float (35)
-
Gem
:: Requirement (12) -
Gem
:: Version (24) - Hash (100)
- IO (24)
- Integer (24)
- MatchData (12)
- Matrix (12)
- Method (24)
- Module (36)
- NilClass (12)
- Object (39)
-
OpenSSL
:: BN (12) - OpenStruct (14)
- OptionParser (24)
- Pathname (123)
- Proc (24)
-
REXML
:: Attribute (12) -
REXML
:: CData (24) -
REXML
:: Child (24) -
REXML
:: DocType (12) -
REXML
:: Element (72) -
REXML
:: Elements (60) -
REXML
:: Entity (12) -
REXML
:: Text (36) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (12) - Range (24)
- Rational (24)
- Regexp (24)
- Set (16)
- String (108)
- StringIO (12)
- Struct (24)
- Symbol (23)
- Thread (40)
-
Thread
:: Backtrace :: Location (24) - Time (18)
- TrueClass (12)
- UnboundMethod (36)
- UncaughtThrowError (11)
- Vector (12)
-
WIN32OLE
_ EVENT (12)
モジュール
- Enumerable (24)
-
Fiddle
:: Importer (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12)
キーワード
- % (12)
- << (12)
- []= (12)
- add (12)
-
add
_ element (12) -
add
_ namespace (24) -
add
_ trace _ func (12) - bind (12)
- binread (12)
- chown (12)
- delete (12)
-
delete
_ all (12) -
delete
_ element (12) -
delete
_ namespace (12) - dirname (12)
-
each
_ entry (15) -
each
_ line (24) - entities (12)
-
fetch
_ values (2) - fnmatch (12)
- grep (12)
-
grep
_ v (10) - handler= (12)
- help (12)
- hex (12)
- hexdigest (12)
- inspect (193)
- intern (12)
- join (12)
-
method
_ missing (12) - name (29)
-
next
_ sibling= (12) - oct (12)
- owner (12)
-
prev
_ float (11) -
previous
_ sibling= (12) -
set
_ trace _ func (12) - split (12)
- src (12)
-
start
_ with? (6) - syswrite (12)
- text= (12)
- then (7)
-
to
_ csv (24) -
to
_ f (12) -
to
_ h (14) -
to
_ i (12) -
to
_ json (12) -
to
_ proc (12) -
to
_ set (24) -
to
_ str (24) -
to
_ string (12) -
to
_ sym (12) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - uniq (12)
- uniq! (12)
- value (24)
- value= (12)
- version (12)
- write (24)
-
yield
_ self (8)
検索結果
先頭5件
-
Gem
:: Requirement # to _ s -> String (30320.0) -
条件を表す文字列を返します。
...条件を表す文字列を返します。
//emlist[][ruby]{
req = Gem::Requirement.new(["< 5.0", ">= 1.9"])
p req.to_s # => "< 5.0, >= 1.9"
//}... -
UncaughtThrowError
# to _ s -> String (30320.0) -
self を tag を含む文字列表現にして返します。
...self を tag を含む文字列表現にして返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}... -
Vector
# to _ s -> String (30320.0) -
ベクトル(Vector)から文字列 (String) に変換します。
...ベクトル(Vector)から文字列 (String) に変換します。
//emlist[例][ruby]{
require 'matrix'
v = Vector[2, 3, 5, 7, 9]
p v.to_s
# => "Vector[2, 3, 5, 7, 9]"
//}... -
Regexp
# to _ s -> String (27350.0) -
正規表現の文字列表現を生成して返します。返される文字列は他の正規表 現に埋め込んでもその意味が保持されるようになっています。
...現に埋め込んでもその意味が保持されるようになっています。
//emlist[][ruby]{
re = /foo|bar|baz/i
p re.to_s # => "(?i-mx:foo|bar|baz)"
p /#{re}+/o # => /(?i-mx:foo|bar|baz)+/
//}
ただし、後方参照を含む正規表現は意図通りにはならない場......emlist[][ruby]{
re = /(foo|bar)\1/ # \1 は、foo か bar
p /(baz)#{re}/ # \1 は、baz
# => /(baz)(?-mix:(foo|bar)\1)/
//}
//emlist[使用例][ruby]{
re = /foo|bar|baz/i
p re.to_s # => "(?i-mx:foo|bar|baz)"
p /#{re}+/o # => /(?i-mx:foo|bar|baz)+/
//}
@see Regexp#inspect... -
String
# to _ s -> String (27350.0) -
self を返します。
...list[例][ruby]{
p "str".to_s # => "str"
p "str".to_str # => "str"
//}
このメソッドは、文字列を他のクラスのインスタンスと混ぜて処理したいときに有効です。
例えば返り値が文字列か nil であるメソッド some_method があるとき、
to_s......メソッドを使うと以下のように統一的に処理できます。
//emlist[例][ruby]{
# some_method(5).downcase だと返り値が nil のときに
# エラーになるので to_s をはさむ
p some_method(5).to_s.downcase
//}... -
Range
# to _ s -> String (27342.0) -
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。
...self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。
@see Range#inspect
//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//}... -
REXML
:: Text # to _ s -> String (27338.0) -
テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。
...トとして妥当です。
結果は REXML::Text.new で指定した entity_filter を反映しています。
@see REXML::Text#value
//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "< & foobar"
t.value # => "< & foobar"
//}... -
Rational
# to _ s -> String (27338.0) -
自身を人間が読みやすい形の文字列表現にして返します。
..."-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... -
Gem
:: Version # to _ s -> String (27320.0) -
バージョン情報を文字列として返します。
...バージョン情報を文字列として返します。
//emlist[][ruby]{
version = Gem::Version.new("1.2.3a")
p version.to_s # => "1.2.3a"
p version.version # => "1.2.3a"
//}...