1432件ヒット
[1-100件を表示]
(0.051秒)
ライブラリ
クラス
-
ARGF
. class (48) - Array (76)
- BasicObject (36)
- Data (6)
- ERB (24)
-
Encoding
:: Converter (12) - Enumerator (36)
-
Enumerator
:: Lazy (12) - File (12)
- IO (12)
- Integer (12)
- Matrix (36)
- Module (12)
-
Net
:: SMTP (24) -
Net
:: Telnet (4) - Object (84)
- OptionParser (36)
-
RDoc
:: Markup (36) -
Rake
:: Application (12) - Range (12)
- Regexp (24)
- Set (16)
-
Shell
:: Filter (18) - String (24)
- Struct (12)
- Thread (12)
-
Thread
:: Backtrace :: Location (36) - UNIXSocket (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (36) -
WIN32OLE
_ PARAM (24) -
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ TYPELIB (24) -
WIN32OLE
_ VARIABLE (24) -
Zlib
:: GzipReader (36) -
Zlib
:: GzipWriter (36)
モジュール
- Benchmark (12)
-
ERB
:: DefMethod (12) - Enumerable (60)
- JSON (36)
-
JSON
:: Generator :: GeneratorMethods :: String (12) - Kernel (58)
- ObjectSpace (24)
-
RubyVM
:: AbstractSyntaxTree (3)
オブジェクト
- ENV (24)
キーワード
- << (12)
- Location (12)
- Markup (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - OCSP (12)
- Request (12)
- Status (12)
- UndefinedConversionError (12)
- YAMLTree (12)
- [] (12)
-
absolute
_ path (12) -
add
_ html (12) -
add
_ special (12) -
add
_ word _ pair (12) - bigdecimal (12)
-
bigdecimal
/ math (12) -
create
_ id= (12) - cycle (36)
- deconstruct (3)
-
deconstruct
_ keys (3) -
def
_ erb _ method (12) - delete (24)
- each (84)
-
each
_ byte (12) -
each
_ line (36) -
each
_ object (24) -
each
_ with _ index (12) -
enum
_ for (24) - fetch (36)
- flock (12)
- foreach (12)
- gsub (12)
- handler= (12)
- help (12)
- helpstring (12)
-
insert
_ output (12) - inspect (32)
- iterator? (12)
- loop (10)
- match (24)
-
max
_ by (48) - measure (12)
- name (48)
-
net
/ http (12) - new (16)
- next (12)
- of (3)
- prepended (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - print (12)
- putc (12)
- rake (12)
-
rdoc
/ markup / to _ ansi (12) -
rdoc
/ markup / to _ bs (12) -
rdoc
/ markup / to _ html (12) - ready (12)
-
respond
_ to? (12) - result (12)
- rss (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
send
_ io (12) - separator (12)
-
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) - src (12)
- tap (12)
- times (12)
-
to
_ a (6) -
to
_ csv (4) -
to
_ enum (24) -
to
_ json (12) -
to
_ s (98) -
top
_ level (12) - tracer (12)
- upto (12)
- warn (12)
-
with
_ index (12) -
with
_ object (24) - write (12)
- | (6)
- クラス/メソッドの定義 (12)
- 制御構造 (12)
検索結果
先頭5件
-
Kernel
. # puts(*arg) -> nil (18155.0) -
引数と改行を順番に 標準出力 $stdout に出力します。 引数がなければ改行のみを出力します。
...られた場合には、
当該オブジェクトを最初に to_ary により配列へ、
次に to_s メソッドにより文字列へ変換を試みます。
末尾が改行で終っている引数や配列の要素に対しては puts 自身
は改行を出力しません。
@param arg 出力......に失敗した場合に発生します。
//emlist[例][ruby]{
puts "foo", "bar\n", "baz"
puts "" # 改行のみ出力
puts # 改行のみ出力
puts nil # 改行のみ出力
puts ["oui", "non"]
#=> foo
# bar
# baz
#
#
#
# oui
# non
//}
@see Kernel.#print, Kernel.#p, IO#puts... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (12149.0) -
自身から生成した JSON 形式の文字列を返します。
...指定します。
//emlist[例][ruby]{
require "json"
puts "test".to_json # => "test"
puts '"'.to_json # => "\""
puts "\\".to_json # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}... -
Object
# respond _ to?(name , include _ all = false) -> bool (6179.0) -
オブジェクトがメソッド name を持つとき真を返します。
...ソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。
@param inc......D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag
module Template
def main
start
template_method
finish
end
def start
puts "start"
end
def......end
def finish
puts "finish"
end
end
class ImplTemplateMethod
include Template
def template_method
"implement template_method"
end
end
class NotImplTemplateMethod
include Template
# not implement template_method
end
puts ImplTemplateMethod.new.respond_to?(:template_method... -
Array
# to _ csv(**options) -> String (6161.0) -
CSV.generate_line(self, options) と同様です。
...します。
//emlist[][ruby]{
require 'csv'
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}
Ruby 3.0 (CSV 3.......になりました。
//emlist[][ruby]{
require 'csv'
puts [1, nil].to_csv # => 1,
puts [1, nil].to_csv(write_nil_value: "N/A") # => 1,N/A
puts [2, ""].to_csv # => 2,""
puts [2, ""].to_csv(write_empty_value: "BLANK") # => 2,BLANK
//}
@... -
Thread
:: Backtrace :: Location # to _ s -> String (6131.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>'
//}... -
Object
# to _ s -> String (6125.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... -
Shell
:: Filter # to _ a -> [String] (6113.0) -
実行結果を文字列の配列で返します。
...実行結果を文字列の配列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a... -
Shell
:: Filter # to _ s -> String (6113.0) -
実行結果を文字列で返します。
...実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}... -
String
# upto(max , exclusive = false) {|s| . . . } -> self (6112.0) -
self から始めて max まで 「次の文字列」を順番にブロックに与えて繰り返します。 「次」の定義については String#succ を参照してください。
...以下のコードは a, b, c, ... z, aa, ... az, ..., za を
出力します。
//emlist[][ruby]{
("a" .. "za").each do |str|
puts str
end
'a'.upto('za') do |str|
puts str
end
//}
@param max 繰り返しをやめる文字列
@param exclusive max を含むかどうか。false の場合は... -
BasicObject
# singleton _ method _ added(name) -> object (6106.0) -
特異メソッドが追加された時にインタプリタから呼び出されます。
...emlist[例][ruby]{
class Foo
def singleton_method_added(name)
puts "singleton method \"#{name}\" was added"
end
end
obj = Foo.new
def obj.foo
end
#=> singleton method "foo" was added
//}
@see Module#method_added,BasicObject#singleton_method_removed,BasicObject#singleton_method_undefined...