るりまサーチ

最速Rubyリファレンスマニュアル検索!
18097件ヒット [1-100件を表示] (0.189秒)
トップページ > クエリ:i[x] > クエリ:l[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

Encoding::InvalidByteSequenceError#incomplete_input? -> bool (24302.0)

エラー発生時に入力文字列が不足している場合に真を返します。

...す。

//emlist[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")

begin
ec.convert("abc\xA1z")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "z" on EUC-JP>
p $!.incomplete_input? #=> false
end

begin
ec.conve...
...rt("abc\xA1")
ec.finish
rescue Encoding::InvalidByteSequenceError
p $! #=> #<Encoding::InvalidByteSequenceError: incomplete "\xA1" on EUC-JP>
p $!.incomplete_input? #=> true
end
//}...

RubyVM::InstructionSequence.compile_file(file, options = nil) -> RubyVM::InstructionSequence (21702.0)

引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。

RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。

@param file...
...tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

# /tmp/hello.rb
puts "Hello, world!"

# i...
...rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>

@see RubyVM::InstructionSequence.compile...

Encoding::InvalidByteSequenceError#destination_encoding -> Encoding (21302.0)

エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。

...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。

@see Encoding::InvalidByteSequenceError#source_encoding,
Encoding::UndefinedConversionError#destination_encoding...

Encoding::InvalidByteSequenceError#destination_encoding_name -> String (21302.0)

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

@see Encoding::InvalidByteSequenceError#destination_encoding...

Object::TOPLEVEL_BINDING -> Binding (18502.0)

トップレベルでの Binding オブジェクト。

...トップレベルでの Binding オブジェクト。

詳細は Binding を参照してください。...

絞り込み条件を変える

ARGF.class#internal_encoding -> Encoding | nil (18402.0)

ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。

...nil を返します。

まだ読み込み処理を始めていない場合は Encoding.default_external を返します。

ARGF.class#set_encoding で設定します。


例:
# $ ruby -Eutf-8 test.rb

# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
ARGF.set_encoding('u...
...tf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>

例:
ARGF.binmode
ARGF.internal_encoding # => nil

@see IO, ARGF.class#external_encoding...

FileTest.#file?(file) -> bool (18402.0)

ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...false を返します。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

例:
FileTest.file?('/bin/bash') # => true
FileTest.file?(...
...'/bin') # => false
FileTest.file?('/no_such_file') # => false...

Object#define_singleton_method(symbol) { ... } -> Symbol (18326.0)

self に特異メソッド name を定義します。

...self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Sy...
...mbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello...
...#=> "Bob: Hello there!"
//}...

Object#define_singleton_method(symbol, method) -> Symbol (18326.0)

self に特異メソッド name を定義します。

...self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Sy...
...mbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello...
...#=> "Bob: Hello there!"
//}...

Object#instance_variable_defined?(var) -> bool (18302.0)

インスタンス変数 var が定義されていたら真を返します。

...Symbol で指定します。

//emlist[][ruby]{
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}...
...@see Object#instance_variable_get,Object#instance_variable_set,Object#instance_variables...

絞り込み条件を変える

<< 1 2 3 ... > >>