別のキーワード
種類
- インスタンスメソッド (300)
- 特異メソッド (33)
- 変数 (14)
- クラス (11)
クラス
-
ARGF
. class (11) - Bignum (3)
-
Enumerator
:: Lazy (85) - Fixnum (3)
- Integer (32)
- Method (6)
- Module (11)
- Object (11)
- Proc (6)
-
Process
:: Status (11) - Range (11)
-
RubyVM
:: InstructionSequence (66) - String (77)
モジュール
- Kernel (14)
キーワード
-
$ -K (7) -
$ KCODE (7) - Numeric (11)
- [] (21)
-
absolute
_ path (11) -
base
_ label (11) - chunk (22)
- compile (11)
- gsub (44)
- label (11)
- new (22)
- path (11)
- prepend (11)
-
singleton
_ class (11) -
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - sub (33)
-
to
_ io (11)
検索結果
先頭5件
-
Integer
# [](nth) -> Integer (8.0) -
nth 番目のビット(最下位ビット(LSB)が 0 番目)が立っている時 1 を、そうでなければ 0 を返します。
...> 0000000000000000011001100101010
a = 9**15
50.downto(0) {|n| print a[n] }
# => 000101110110100000111000011110010100111100010111001
//}
n[i] は (n >> i) & 1 と等価なので、負のインデックスは常に 0 を返します。
//emlist[][ruby]{
p 255[-1] # => 0
//}
self[nth]=bit (つま... -
Numeric (8.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...o o - -
>= | - - o o o - -
>> | - - o o - - -
[] | - - o......> | - o o - -
>= | - o o - -
>> | - o - - -
[] | - o - - -... -
Object
# singleton _ class -> Class (8.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:String>
nil.singleton_class #=> NilClass
//}
@see Object#class... -
Range
. new(first , last , exclude _ end = false) -> Range (8.0) -
first から last までの範囲オブジェクトを生成して返しま す。
...) # => 1...10
//}
//emlist[例: 日付オブジェクトの範囲オブジェクトの場合][ruby]{
require 'date'
Range.new(Date.today, Date.today >> 1).each {|d| puts d }
# => 2017-09-16
# 2017-09-17
# ...
# 2017-10-16
//}
//emlist[例: IPアドレスの範囲オブジェクトの場... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (8.0) -
self が表す命令シーケンスの絶対パスを返します。
...例1:irb で実行した場合
iseq = 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 "hell... -
RubyVM
:: InstructionSequence # base _ label -> String (8.0) -
self が表す命令シーケンスの基本ラベルを返します。
...例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts... -
RubyVM
:: InstructionSequence # label -> String (8.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hel... -
RubyVM
:: InstructionSequence # path -> String (8.0) -
self が表す命令シーケンスの相対パスを返します。
...例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hell... -
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (8.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (8.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file...