1736件ヒット
[1-100件を表示]
(0.040秒)
ライブラリ
クラス
- Array (44)
- BigDecimal (55)
- Bignum (6)
- Data (4)
-
Fiddle
:: Pointer (66) - Fixnum (6)
- Float (20)
- Hash (33)
- IO (11)
- Method (22)
- Object (48)
- OpenStruct (12)
- Pathname (746)
- Proc (22)
-
REXML
:: Child (22) -
REXML
:: Element (33) -
REXML
:: NotationDecl (11) -
REXML
:: Text (11) - Range (33)
- String (44)
- StringIO (11)
- Struct (22)
- Symbol (252)
-
Thread
:: Backtrace :: Location (11) -
URI
:: Generic (11) - UnboundMethod (22)
- UncaughtThrowError (10)
-
WIN32OLE
_ TYPE (33) -
Zlib
:: GzipWriter (11)
キーワード
- % (22)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (33)
- =~ (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) - Numeric (11)
- Observable (11)
- [] (77)
- []= (22)
-
add
_ namespace (22) - atime (11)
- basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- capitalize (11)
- chardev? (11)
- chmod (11)
- chown (11)
- ctime (11)
-
define
_ singleton _ method (22) -
delete
_ namespace (11) - directory? (11)
- dirname (11)
- downcase (11)
-
each
_ entry (13) -
each
_ line (22) - empty? (8)
-
end
_ with? (5) - executable? (11)
-
executable
_ real? (11) - exist? (11)
- extname (11)
- file? (11)
- find (22)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- grpowned? (11)
- hex (11)
- inspect (74)
- irb (11)
- lchmod (11)
- lchown (11)
- length (11)
- lstat (11)
-
make
_ link (11) -
make
_ symlink (11) - match (11)
- merge! (11)
- mkdir (11)
- mkpath (11)
- modulo (11)
- mtime (11)
- name (11)
- new (22)
- next (11)
-
next
_ float (10) -
next
_ sibling= (11) - open (22)
- opendir (22)
- owned? (11)
- pipe? (11)
-
prev
_ float (10) -
previous
_ sibling= (11) -
proc
_ to _ s (11) - profile (6)
- read (11)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- remainder (11)
- rename (11)
- rmdir (11)
- rmtree (11)
-
ruby 1
. 6 feature (11) - setgid? (11)
- setuid? (11)
- size (22)
- size? (11)
- slice (55)
- socket? (11)
- split (11)
-
start
_ with? (5) - stat (11)
- sticky? (11)
- succ (11)
- swapcase (11)
- symlink? (11)
- sysopen (11)
- then (12)
-
to
_ h (12) -
to
_ proc (11) -
to
_ str (33) -
to
_ sym (11) -
transform
_ keys! (17) -
transform
_ values! (16) - truncate (11)
- uniq (22)
- uniq! (22)
- upcase (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
-
yield
_ self (14) - zero? (11)
- メソッド呼び出し(super・ブロック付き・yield) (9)
検索結果
先頭5件
-
BigDecimal
# to _ s -> String (18178.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定さ......decimal"
BigDecimal("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"
//}
さらに文字列の最後に指数形式 ('E' または 'e')... -
BigDecimal
# to _ s(n) -> String (18178.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定さ......decimal"
BigDecimal("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"
//}
さらに文字列の最後に指数形式 ('E' または 'e')... -
Range
# to _ s -> String (18145.0) -
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。
...
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。
@see Range#inspect
//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//}... -
String
# to _ s -> String (18141.0) -
self を返します。
...
self を返します。
//emlist[例][ruby]{
p "str".to_s # => "str"
p "str".to_str # => "str"
//}
このメソッドは、文字列を他のクラスのインスタンスと混ぜて処理したいときに有効です。
例えば返り値が文字列か nil であるメソッド some_met......hod があるとき、
to_s メソッドを使うと以下のように統一的に処理できます。
//emlist[例][ruby]{
# some_method(5).downcase だと返り値が nil のときに
# エラーになるので to_s をはさむ
p some_method(5).to_s.downcase
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (18123.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... -
UncaughtThrowError
# to _ s -> String (18123.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
//}... -
REXML
:: NotationDecl # to _ s -> String (18117.0) -
self を文字列化したものを返します。
...self を文字列化したものを返します。... -
Fixnum
# to _ s(base = 10) -> String (15153.0) -
self を引数で指定した基数の文字列表現に変換します。
...
self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345.to_s #=> "12345"
12345.to_s(2) #=> "11000000111001"
12345.to_s(8) #=> "30071"
12345.to_s(10) #=> "12345"
12345.to_s(16)......#=> "3039"
12345.to_s(36) #=> "9ix"... -
Bignum
# to _ s(base = 10) -> String (15147.0) -
self を引数で指定した基数の文字列表現に変換します。
...
self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345654321.to_s #=> "12345654321"
12345654321.to_s(2) #=> "1011011111110110111011110000110001"
12345654321.to_s(8) #=> "133766736......061"
12345654321.to_s(16) #=> "2dfdbbc31"
78546939656932.to_s(36) #=> "rubyrules"... -
Proc
# to _ s -> String (15129.0) -
self の文字列表現を返します。
...
self の文字列表現を返します。
可能なら self を生成したソースファイル名、行番号を含みます。
//emlist[例][ruby]{
p Proc.new {
true
}.to_s
# => "#<Proc:0x0x401a880c@-:3>"
//}... -
WIN32OLE
_ TYPE # to _ s -> String (15123.0) -
selfの型名を取得します。
...selfの型名を取得します。
@return selfの型名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
p tobj.name # => "Application"...