2251件ヒット
[1-100件を表示]
(0.047秒)
ライブラリ
- ビルトイン (1130)
- benchmark (12)
- bigdecimal (60)
- csv (48)
- digest (36)
- erb (12)
- fiddle (24)
-
fiddle
/ import (12) - json (12)
- matrix (24)
- monitor (12)
- openssl (48)
- optparse (24)
- ostruct (14)
- pathname (168)
- rake (48)
-
rexml
/ document (300) -
rubygems
/ requirement (12) -
rubygems
/ version (24) - set (28)
- stringio (12)
- win32ole (12)
クラス
- Array (84)
- BasicObject (12)
- BigDecimal (60)
-
CSV
:: Row (24) -
CSV
:: Table (24) - Complex (12)
- Data (6)
-
Digest
:: Base (24) - ERB (12)
- Encoding (24)
-
Enumerator
:: Lazy (22) - Exception (24)
- FalseClass (24)
- File (12)
- Float (46)
-
Gem
:: Requirement (12) -
Gem
:: Version (24) - Hash (100)
- IO (24)
- Integer (24)
- MatchData (12)
- Matrix (12)
- Method (24)
- Module (36)
- NilClass (12)
- Object (78)
-
OpenSSL
:: BN (48) - OpenStruct (14)
- OptionParser (24)
- Pathname (168)
- Proc (24)
-
REXML
:: Attribute (12) -
REXML
:: CData (36) -
REXML
:: Child (24) -
REXML
:: DocType (12) -
REXML
:: Element (72) -
REXML
:: Elements (60) -
REXML
:: Entity (12) -
REXML
:: Text (48) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (36) - Range (36)
- Rational (24)
- Regexp (24)
- Set (16)
- String (108)
- StringIO (12)
- Struct (24)
- Symbol (41)
- Thread (40)
-
Thread
:: Backtrace :: Location (24) - Time (18)
- TrueClass (12)
- UnboundMethod (36)
- UncaughtThrowError (11)
- Vector (12)
-
WIN32OLE
_ EVENT (12)
モジュール
- Benchmark (12)
- Enumerable (24)
-
Fiddle
:: Importer (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (84)
キーワード
- % (24)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (12)
- Base (12)
- BlockCaller (12)
- Closure (12)
- ExternalEntity (12)
- Location (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - NotationDecl (12)
- Numeric (12)
- String (12)
- Symbol (12)
- []= (12)
- add (12)
-
add
_ element (12) -
add
_ namespace (24) -
add
_ trace _ func (12) -
all
_ symbols (12) - append (12)
- atime (12)
- basename (12)
- bigdecimal (12)
-
bigdecimal
/ math (12) - bind (12)
- binread (12)
- chown (12)
- ctime (12)
-
define
_ singleton _ method (24) - delete (12)
-
delete
_ all (12) -
delete
_ element (12) -
delete
_ namespace (12) - dirname (12)
-
each
_ entry (15) -
each
_ line (24) - empty? (9)
-
end
_ with? (6) - entities (12)
- fnmatch (12)
- format (12)
- grep (12)
-
grep
_ v (10) - handler= (12)
- help (12)
- hex (12)
- hexdigest (12)
- inspect (193)
- intern (12)
- irb (12)
- join (12)
- lchmod (12)
- measure (12)
-
method
_ missing (12) - modulo (12)
- name (29)
- new (84)
-
next
_ float (11) -
next
_ sibling= (12) - oct (12)
-
optparse
/ date (12) - owner (12)
-
prev
_ float (11) -
previous
_ sibling= (12) - print (12)
- profile (6)
- puts (12)
-
rb
_ ary _ pop (12) - remainder (12)
- resolv (12)
- rss (12)
-
ruby 1
. 6 feature (12) -
set
_ trace _ func (24) - split (12)
- sprintf (12)
- sprintf フォーマット (12)
- src (12)
-
start
_ with? (6) - syswrite (12)
- text= (12)
- then (14)
-
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) - tracer (12)
-
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - uniq (24)
- uniq! (24)
- value (24)
- value= (12)
- version (12)
- warn (12)
- write (24)
-
yield
_ self (16) - メソッド呼び出し(super・ブロック付き・yield) (10)
検索結果
先頭5件
-
BigDecimal
# to _ s -> String (18192.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
Bi......gDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}
引数 n に正の整数を表す文字列を指定することもできます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.1234567890 123456789e0"
//}
文字列の......ます。負の場合は常に '-' が付きます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.123456").to_s(" 3") # => " 0.123 456e0"
BigDecimal("0.123456").to_s("+3") # => "+0.123 456e0"
BigDecimal("-0.123456").to_s("3") # => "-0.123 456e0"
//}
さらに文字列の最後に指数形... -
BigDecimal
# to _ s(n) -> String (18192.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
Bi......gDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}
引数 n に正の整数を表す文字列を指定することもできます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.1234567890 123456789e0"
//}
文字列の......ます。負の場合は常に '-' が付きます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.123456").to_s(" 3") # => " 0.123 456e0"
BigDecimal("0.123456").to_s("+3") # => "+0.123 456e0"
BigDecimal("-0.123456").to_s("3") # => "-0.123 456e0"
//}
さらに文字列の最後に指数形... -
OpenSSL
:: BN # to _ s(base=10) -> String (18191.0) -
自身を表す文字列を返します。
...ist[][ruby]{
require 'openssl'
p 10.to_bn.to_s # => "10"
p (-5).to_bn.to_s # => "-5"
p 0.to_bn.to_s(16) # => "0"
p 9.to_bn.to_s(16) # => "09"
p 10.to_bn.to_s(16) # => "0A"
p 16.to_bn.to_s(16) # => "10"
p 26.to_bn.to_s(16) # => "1A"
p 256.to_bn.to_s(16) # => "0100"
p 0.to_bn.to_s(2) #......=> ""
p 6.to_bn.to_s(2) # => "\x06"
p 7.to_bn.to_s(2) # => "\a"
p 0.to_bn.to_s(0) # => "\x00\x00\x00\x00"
p 6.to_bn.to_s(0) # => "\x00\x00\x00\x01\x06"
p 7.to_bn.to_s(0) # => "\x00\x00\x00\x01\a"
//}
反対に、文字列から OpenSSL::BN クラスのインスタンスを作るには
OpenSSL::BN.... -
Complex
# to _ s -> String (18137.0) -
自身を "実部 + 虚部i" 形式の文字列にして返します。
...す。
//emlist[例][ruby]{
Complex(2).to_s # => "2+0i"
Complex('-8/6').to_s # => "-4/3+0i"
Complex('1/2i').to_s # => "0+1/2i"
Complex(0, Float::INFINITY).to_s # => "0+Infinity*i"
Complex(Float::NAN, Float::NAN).to_s # => "NaN+NaN*i"
//}... -
String
# to _ s -> String (18137.0) -
self を返します。
...t[例][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 (18135.0) -
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。
...self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。
@see Range#inspect
//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//}... -
Rational
# to _ s -> String (18131.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... -
Regexp
# to _ s -> String (18131.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 # => /(?... -
Time
# to _ s -> String (18119.0) -
時刻を文字列に変換した結果を返します。 以下のようにフォーマット文字列を使って strftime を呼び出すのと同じです。
...me を呼び出すのと同じです。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t.to_s # => "2000-01-02 03:04:05 +0900"
p t.strftime("%Y-%m-%d %H:%M:%S %z") # => "2000-01-02 03:04:05 +0900"
p t.utc.to_s # => "2000-01-01 18:04:0...