るりまサーチ

最速Rubyリファレンスマニュアル検索!
1900件ヒット [1-100件を表示] (0.157秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

StringIO#puts(*obj) -> nil (24230.0)

obj と改行を順番に自身に出力します。引数がなければ改行のみを出力します。 詳しい仕様は Kernel.#puts を参照して下さい。

...は Kernel.#puts を参照して下さい。

@param obj 書き込みたいオブジェクトを指定します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.puts("hoge", "bar...
...", "foo")
a.string #=> "hoge\nbar\nfoo\n"
//}...

XMP#puts(exps) -> nil (24224.0)

引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。

...引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行
ごとに交互に表示します。

@param exps 評価するRuby のソースコードを文字列で指定します。...

CSV#puts(row) -> self (18220.0)

自身に row を追加します。

...ist[例 配列を指定][ruby]{
require "csv"

File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
CSV.open("test.csv", "a") do |csv|
csv.puts(["5", "saburo", "kondo", "34"])
end

print File.read("test.csv")
# => id,first n...
...ame,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}

//emlist[例 CSV::Row を指定][ruby]{
require "csv"

File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,a...
...21
CSV
CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end

print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,...

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (12131.0)

自身から生成した JSON 形式の文字列を返します。

...ドは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のイ...
...JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

puts
"test".to_json # => "test"
puts
'"'.to_json # => "\""
puts
"\\".to_json # => "\\"
puts
"𤘩宮城".to_json(a...
...scii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...

RubyVM::AbstractSyntaxTree::Node#inspect -> String (12113.0)

self のデバッグ用の情報を含んだ文字列を返します。

...self のデバッグ用の情報を含んだ文字列を返します。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts
node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//}...

絞り込み条件を変える

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (9313.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...t_compiledイベント発生時にコンパイルされた
Ruby
VM::InstructionSequenceインスタンスを返します。

//emlist[例][ruby]{
T
racePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts...
...'hello'")
end
//}

@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (9243.0)

型が持つソースインターフェイスを取得します。

...す。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるインターフェイス)を返します。

@return デフォ...
...TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は空配列を返します。

t
obj = WIN32OLE_T...
...YPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
t
obj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]

WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返されたインターフェイスが選択されます。

次のサンプル...

Encoding::InvalidByteSequenceError#error_bytes -> String (9119.0)

エラー発生時に捨てられたバイト列を返します。

...//emlist[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1\xFFdef")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
puts
$!.error_bytes.dump #=> "\xA1"
puts
$!.re...
...adagain_bytes.dump #=> "\xFF"
end
//}

@see Encoding::InvalidByteSequenceError#readagain_bytes...

Thread::Backtrace::Location#absolute_path -> String (9113.0)

self が表すフレームの絶対パスを返します。

...list[例][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.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see Thread::Backtrace::Location...
...#path...

RubyVM::InstructionSequence#absolute_path -> String | nil (9107.0)

self が表す命令シーケンスの絶対パスを返します。

...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts
"hello, world"
end

# irb
> iseq = Ruby...
...VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@see RubyVM::InstructionSequence#path...

絞り込み条件を変える

<< 1 2 3 ... > >>