るりまサーチ

最速Rubyリファレンスマニュアル検索!
358件ヒット [201-300件を表示] (0.019秒)

別のキーワード

  1. _builtin >>
  2. date >>
  3. ipaddr >>
  4. bn >>
  5. status >>

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 > >>

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...

絞り込み条件を変える

<< < 1 2 3 4 > >>