1203件ヒット
[101-200件を表示]
(0.237秒)
クラス
-
ARGF
. class (33) - Array (77)
- BasicObject (11)
- Bignum (6)
- Complex (11)
- Data (4)
- Encoding (22)
-
Enumerator
:: Lazy (20) - Exception (22)
- FalseClass (22)
- Fixnum (6)
- Float (42)
- Hash (88)
- IO (33)
- Integer (22)
- MatchData (11)
- Method (22)
- Module (33)
- NameError (11)
- NilClass (11)
- Object (70)
- Proc (22)
-
Process
:: Status (11) - Range (22)
- Rational (22)
- Regexp (22)
- String (99)
- Struct (22)
- Symbol (278)
- Thread (36)
-
Thread
:: Backtrace :: Location (22) - Time (16)
- TrueClass (11)
- UnboundMethod (33)
- UncaughtThrowError (10)
キーワード
- % (11)
- << (11)
- =~ (11)
- [] (55)
-
add
_ trace _ func (11) - capitalize (11)
-
define
_ singleton _ method (22) - downcase (11)
-
end
_ with? (5) - grep (11)
-
grep
_ v (9) - hex (11)
- id2name (11)
- inspect (185)
- intern (11)
- join (11)
- length (11)
- match (11)
-
method
_ missing (11) - name (26)
- next (11)
-
next
_ float (10) - oct (11)
- owner (11)
-
prev
_ float (10) -
set
_ trace _ func (11) - size (11)
- slice (55)
-
start
_ with? (5) - succ (11)
- swapcase (11)
- syswrite (11)
- then (12)
-
to
_ f (11) -
to
_ i (11) -
to
_ proc (11) -
to
_ str (22) -
to
_ sym (22) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - uniq (22)
- uniq! (22)
- upcase (11)
- write (22)
-
yield
_ self (14)
検索結果
先頭5件
-
NilClass
# to _ s -> String (26110.0) -
空文字列 "" を返します。
...空文字列 "" を返します。
//emlist[例][ruby]{
nil.to_s # => ""
//}... -
Object
# to _ s -> String (26110.0) -
オブジェクトの文字列表現を返します。
...使って文字列に変換し
ます。
//emlist[][ruby]{
class Foo
def initialize num
@num = num
end
end
it = Foo.new(40)
puts it #=> #<Foo:0x2b69110>
class Foo
def to_s
"Class:Foo Number:#{@num}"
end
end
puts it #=> Class:Foo Number:40
//}
@see Object#to_str,Kernel.#String... -
Thread
:: Backtrace :: Location # to _ s -> String (26110.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...mlist[例][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.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
TrueClass
# to _ s -> String (26110.0) -
常に文字列 "true" を返します。
...常に文字列 "true" を返します。
//emlist[例][ruby]{
true.to_s # => "true"
//}... -
UncaughtThrowError
# to _ s -> String (26110.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
//}... -
Fixnum
# to _ s(base = 10) -> String (23140.0) -
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"... -
Float
# to _ s -> String (23140.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...列を返します。
//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"
(1.0/0.0).to_s # => "Infinity"
(0.0/0.0).to_s # => "NaN"
//}... -
Bignum
# to _ s(base = 10) -> String (23134.0) -
self を引数で指定した基数の文字列表現に変換します。
...を 2 から 36 の整数で指定します。
12345654321.to_s #=> "12345654321"
12345654321.to_s(2) #=> "1011011111110110111011110000110001"
12345654321.to_s(8) #=> "133766736061"
12345654321.to_s(16) #=> "2dfdbbc31"
78546939656932.to_s(36) #=> "rubyrules"... -
Integer
# to _ s(base=10) -> String (23128.0) -
整数を 10 進文字列表現に変換します。
...を指定すれば、それを基数とした文字列表
現に変換します。
//emlist[][ruby]{
p 10.to_s(2) # => "1010"
p 10.to_s(8) # => "12"
p 10.to_s(16) # => "a"
p 35.to_s(36) # => "z"
//}
@return 数値の文字列表現
@param base 基数となる 2 - 36 の数値。
@rai... -
Module
# to _ s -> String (23116.0) -
モジュールやクラスの名前を文字列で返します。
...lass C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b09112c8>"
p Class.new.to_s #=> "#<Class:0x00007fa5c40b41b0>"
//}... -
Array
# to _ s -> String (23110.0) -
自身の情報を人間に読みやすい文字列にして返します。
...自身の情報を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
[1, 2, 3, 4].to_s # => "[1, 2, 3, 4]"
[1, 2, 3, 4].inspect # => "[1, 2, 3, 4]"
//}...