×閉じる
ドキュメント mruby/c

クラス・ライブラリ一覧

目次

mruby/c 3.1以降
  クラス・ライブラリ一覧
  クラスツリー
mruby/c 2.1
  クラス・ライブラリ一覧
  例外クラス

mruby/c 3.1以降

対象となる組込みクラス・機能

class method  v3.2 v3.1 
Object   sleep
loop
printf
sprintf
to_s
inspect
raise
block_given?
nil?
kind_of?
is_a?
attr_accessor
attr_reader
dup
new
class
===
<=>
!=
!
puts
print
p
FalseClass to_s
inspect
TrueClass to_s
inspect
Array all? -
any? -
collect!
collect
each_with_index
each_index
each
join
to_s
inspect
minmax
max
min
dup
unshift
shift
pop
push
last
first
index
count
length
size
empty?
delete_at
clear
<<
| -
& -
[]=
at
[]
+
Hash











each
to_s
inspect
values
to_h
merge!
merge
count
length
size
keys
key
has_value?
has_key?
empty?
delete
dup
clear
[]=
[]
String
































bytes -
each_char
each_byte
to_f
include?
end_with?
start_with?
tr!
tr
intern
to_sym
strip!
strip
rjust -
ljust -
rstrip!
rstrip
lstrip!
lstrip
split
ord
inspect
index
getbyte
dup
chomp!
chomp
[]=
[]
<<
to_s
to_i
length
size
*
+
Integer
















times
to_s
upto -
downto -
clamp -
inspect
chr
to_f
to_i
abs
>>
<<
~
^
|
&
%
**
-@
+@
[]
Float
 
 
 
 
 
 
clamp -
to_s
inspect
to_f
to_i
abs
-@
+@
Range
 
 
 



each
to_s
inspect
exclude_end?
last
first
===
Symbol




to_sym
id2name
to_s
inspect
all_symbols
NilClass




to_s
inspect
to_f
to_h
to_a
to_i

クラスツリー

Object 全てのクラスのスーパークラス。オブジェクトの一般的な振舞いを定義します。
├ NilClass nil のクラス。nil は NilClass クラスの唯一のインスタンスです。nil は false オブジェクトとともに偽を表し、その他の全てのオブジェクトは真です。
├ TrueClass true のクラス。true は TrueClass クラスの唯一のインスタンスです。true は真を表す代表のオブジェクトです。
├ FalseClass falseのクラス。falseはFalseClassクラスの唯一のインスタンスです。falseはnilオブジェクトとともに偽を表し、その他の全てのオブジェクトは真です。
├ Integer 整数クラスです。
├ Float 浮動小数点数のクラス。Float の実装は C 言語の double で、その精度は環境に依存します。
├ String 文字列のクラスです。ヌル文字を含む任意のバイト列を扱うことができます。文字列の長さにはメモリ容量以外の制限はありません。
├ Math 浮動小数点演算をサポートするモジュールです。
├ Proc ブロックをコンテキスト(ローカル変数のスコープやスタックフレーム)とともにオブジェクト化した手続きオブジェクトです。
├ Array 配列クラスです。配列は任意の Ruby オブジェクトを要素として持つことができます。
├ Hash ハッシュテーブル(連想配列とも呼ぶ)のクラスです。ハッシュは任意の種類のオブジェクト(キー)から任意の種類のオブジェクト(値)への関連づけを行うことができます。
├ Range 範囲オブジェクトのクラス。範囲オブジェクトは文字どおり何らかの意味での範囲を表します。数の範囲はもちろん、日付の範囲や、「"a" から "z" まで」といった文字列の範囲を表すこともできます。
└ Exception 全ての例外の祖先のクラスです。
  ├ NoMemoryError メモリの確保に失敗すると発生します。
  ├ NotImplementedError 現在のプラットフォームで実装されていない機能が呼び出されたときに発生します。
  └ StandardError 通常のプログラムで発生する可能性の高い例外クラスを束ねるためのクラスです。
    ├ RuntimeError 特定の例外クラスには該当しないエラーが起こったときに発生します。また Kernel.#raise で例外クラスを指定しなかった場合も RuntimeError が発生します。
    ├ ZeroDivisionError 整数に対して整数の 0 で除算を行ったときに発生します。
    ├ ArgumentError 引数の数が合っていないときや、数は合っていて、期待される振る舞いを持ってはいるが、期待される値ではないときに発生します。
    ├ IndexError 添字が範囲外のときに発生します。
    ├ TypeError メソッドの引数に期待される型ではないオブジェクトや、期待される振る舞いを持たないオブジェクトが渡された時に発生します。
    ├ RangeError 範囲に関する例外クラスです。値が定義域から外れているときに発生します。
    └ NameError 未定義のローカル変数や定数を使用したときに発生します。
      └ NoMethodError
定義されていないメソッドの呼び出しが行われたときに発生します。

 

mruby/c 2.1

対象となる組込みクラス・機能

class method
Object   sleep
loop
printf
sprintf
to_s
inspect
raise
block_given?
nil?
kind_of?
is_a?
attr_accessor
attr_reader
dup
new
class
===
<=>
!=
!
puts
print
p
FalseClass to_s
inspect
TrueClass to_s
inspect
Array collect!
collect
each_with_index
each_index
each
join
to_s
inspect
minmax
max
min
dup
unshift
shift
pop
push
last
first
index
count
length
size
empty?
delete_at
clear
<<
[]=
at
[]
=+
Hash











each
to_s
inspect
values
to_h
merge!
merge
count
length
size
keys
key
has_value?
has_key?
empty?
delete
dup
clear
[]=
[]
String
































each_char
each_byte
to_f
include?
end_with?
start_with?
tr!
tr
intern
to_sym
strip!
strip
rstrip!
rstrip
lstrip!
lstrip
split
ord
inspect
index
getbyte
dup
chomp!
chomp
[]=
[]
<<
to_s
to_i
length
size
*
=+
Integer
















times
to_s
inspect
chr
to_f
to_i
abs
>>
<<
~
^
|
&
%
**
-@
=+@
[]
Float
 
 
 
 
 
 
clamp
to_s
inspect
to_f
to_i
abs
-@
=+@
Range
 
 
 



each
to_s
inspect
exclude_end?
last
first
===
Symbol




to_sym
id2name
to_s
inspect
all_symbols
NilClass




to_s
inspect
to_f
to_h
to_a
to_i

例外クラス

Exception 全ての例外の祖先のクラスです。
└ StandardError 通常のプログラムで発生する可能性の高い例外クラスを束ねるためのクラスです。
  ├ RuntimeError 特定の例外クラスには該当しないエラーが起こったときに発生します。また Kernel.#raise で例外クラスを指定しなかった場合も RuntimeError が発生します。
  ├ ZeroDivisionError 整数に対して整数の 0 で除算を行ったときに発生します。
  ├ ArgumentError 引数の数が合っていないときや、数は合っていて、期待される振る舞いを持ってはいるが、期待される値ではないときに発生します。
  ├ IndexError 添字が範囲外のときに発生します。
  └ TypeError メソッドの引数に期待される型ではないオブジェクトや、期待される振る舞いを持たないオブジェクトが渡された時に発生します。

 

 

 

このページのトップへ