るりまサーチ

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

別のキーワード

  1. socket bool
  2. option bool
  3. variant vt_bool
  4. win32ole vt_bool
  5. bool socket

ライブラリ

クラス

キーワード

検索結果

BasicObject#! -> bool (18226.0)

オブジェクトを真偽値として評価し、その論理否定を返します。

...unt = 0
end
attr_reader :count

def !
@count += 1
super
end
end

recorder = NegationRecorder.new
!
recorder
!
!!!!!!recorder
puts 'hoge' if !recorder

puts recorder.count #=> 3
//}

//emlist[例][ruby]{
class AnotherFalse < BasicObject
def !
true
end
end
another_false = Anothe...

Delegator#! -> bool (18202.0)

自身を否定します。

自身を否定します。

BasicObject#!=(other) -> bool (6201.0)

オブジェクトが other と等しくないことを判定します。

...返します。
このため、サブクラスで BasicObject#== を再定義しても != とは自動的に整合性が
とれるようになっています。

ただし、 BasicObject#!= 自身や BasicObject#! を再定義した際には、ユーザーの責任で
整合性を保たなくては...
...icObject#==, BasicObject#!

//emlist[例][ruby]{
class NonequalityRecorder < BasicObject
def initialize
@count = 0
end
attr_reader :count

def !=(other)
@count += 1
super
end
end
recorder = NonequalityRecorder.new

recorder != 1
puts 'hoge' if recorder != "str"

p recorder.coun...

Delegator#!=(obj) -> bool (6201.0)

自身が与えられたオブジェクトと等しくない場合は、真を返します。 そうでない場合は、偽を返します。

自身が与えられたオブジェクトと等しくない場合は、真を返します。
そうでない場合は、偽を返します。

@param obj 比較対象のオブジェクトを指定します。

Object#!~(other) -> bool (6201.0)

自身が other とマッチしない事を判定します。

...身が other とマッチしない事を判定します。

self#=~(obj) を反転した結果と同じ結果を返します。

@param other 判定するオブジェクトを指定します。

//emlist[例][ruby]{
obj = 'regexp'
p (obj !~ /re/) # => false

obj = nil
p (obj !~ /re/) # => true
//}...

絞り込み条件を変える

Object#===(other) -> bool (113.0)

case 式で使用されるメソッドです。d:spec/control#case も参照してください。

...when /ruby(?!\s*on\s*rails)/i
"hit! #{arg}"
when String
"Instance of String class. But don't hit."
else
"unknown"
end
end

puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's wo...

ruby 1.8.4 feature (30.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...!".inspect
puts :"=".inspect
puts :"0".inspect
puts :"$1".inspect
puts :"@1".inspect
puts :"@@1".inspect
puts :"@".inspect
puts :"@@".inspect

# => ruby 1.8.3 (2005-09-21) [i686-linux]
:!...
...:"!"
:"="
:"0"
:$1
:"@1"
:"@@1"
:"@"
:"@@"

3) Symbol#inspect sometimes returns suboptimal symbol representations:
puts :foo!.inspect...
...列であることを期待し
てスクリプトを書いている場合には修正が必要になる場合があります.

例えば bool 値を返す属性については true または false を返すようになり
ます.よって,戻り値が "1", "0" の文字列,ある...