るりまサーチ

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

別のキーワード

  1. object true
  2. _builtin true
  3. rb_true
  4. true
  5. true object

検索結果

<< 1 2 3 > >>

Regexp#~ -> Integer | nil (18113.0)

変数 $_ の値との間でのマッチをとります。

...意味です。

//emlist[][ruby]{
self =~ $_
//}

//emlist[例][ruby]{
$_ = "hogehoge"

if /foo/
puts "match"
else
puts "no match"
end
# => no match
# ただし、警告がでる。warning: regex literal in condition

reg = Regexp.compile("foo")

if ~ reg
puts "match"
else
puts "no match"...
...end
# => no match

if reg
puts "match"
else
puts "no match"
end
# => match
# reg は nil でも false でも無いので常にtrue
//}...

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

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

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

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

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

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

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

Gem::Requirement#=~(version) -> bool (3122.0)

引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。

...満たす場合に true を返します。
そうでなければ、false を返します。

@param version Gem::Version のインスタンスを指定します。

//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")

p req.satisfied_by?(Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?...

ruby 1.6 feature (120.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...とみなされるようになりました。

p Hash.new("foo") == Hash.new("bar")

=> ruby 1.6.7 (2002-03-01) [i586-linux]
true

=> ruby 1.6.7 (2002-08-21) [i586-linux]
false

# : 2002-08-01 IO#read, gets ..., etc.
#
# File::NONBLOCK を指定した...
...正しく埋め込めるようにするためです。
((<ruby-bugs-ja:PR#231>))

p Regexp.quote("#")

p /a#{Regexp.quote("#")}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0...
...になりました。

: 2002-04-26: Regexp.quote

((<ruby-bugs-ja:PR#231>))

p Regexp.quote("\t")

p /a#{Regexp.quote("\t")}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"\t"
0...

演算子式 (120.0)

演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond

...[]
+(単項) ! ~
**
-(単項)
* / %
+ -
<< >>
&
| ^
> >= < <=
<=> == === != =~ !~
&&...
...メソッド定義
などではこの記法を利用します。


//emlist{
| ^ & <=> == === =~ > >= < <= << >>
+ - * / % ** ~ +@ -@ [] []= ` ! != !~
//}
これらの演算子式の定義方法についてはd:spec/def#operatorを参照してください...
...れる
p c.foo # => 5
//}

属性は Module#attr を使って同じように定義できます。

//emlist[例][ruby]{
class C
attr :foo, true
end
c = C.new
c.foo = 5 # c.foo=( 5 ) のように変換される
p c.foo # => 5
//}

====[a:selfassign] 自己代入


//emlist[例][ruby]{
f...

絞り込み条件を変える

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (108.0)

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or  plus minus ast slash hat sq  period comma langl rangl eq tilde  dollar at under lbrarbra  lbra2rbra2 lbra3rbra3 dq colon ac  backslash semicolon

...angl rangl eq tilde 
dollar at under lbrarbra 
lbra2rbra2 lbra3rbra3 dq colon ac 
backslash semicolon

===[a:ex] !

: !true

not 演算子。d:spec/operator#notを参照。

: 3 != 5

「等しくない」比較演算子。d:spec/operator#notを参照。

: def xxx!...
...ドに比べてより破壊的な作用をもつメソッド(例: tr と tr!)で使われます。

: /xxx/ !~ yyy

正規表現のメソッド =~ の否定。マッチが失敗したらtrueを返します。


===[a:q] ?

: ?a

d:spec/literal#string。長さ 1 の文字列。

: def xx?

この...
...意味する

===[a:hat] ^

: true ^ true

「xor」演算子。排他的論理和。または類似のメソッド。

: a ^= true

「^」演算子の自己代入演算子。aの論理値の反転。
//emlist{
p(a=true);p(a^=true);p(a^=true) #=> true false true
//}

: /^xxx/

正規表現...

Kernel.#system(command, options={}) -> bool | nil (71.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ータス 0 で終了すると成功とみなし true を返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil や false を返...
...を参照することで判別可能です。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます...
...ash
@param options オプションパラメータ Hash
@raise Errno::EXXX exception: true が指定されていて、コマンドの実行が失敗したときに発生します。
@raise RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のと...

Kernel.#system(env, command, options={}) -> bool | nil (71.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ータス 0 で終了すると成功とみなし true を返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil や false を返...
...を参照することで判別可能です。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます...
...ash
@param options オプションパラメータ Hash
@raise Errno::EXXX exception: true が指定されていて、コマンドの実行が失敗したときに発生します。
@raise RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のと...

Marshal フォーマット (60.0)

Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。

...ーマットバージョン 4.8 を元に記述しています。

=== nil, true, false

それぞれ、'0', 'T', 'F' になります。

//emlist[][ruby]{
p Marshal.dump(nil).unpack1("x2 a*") # => "0"
p Marshal.dump(true).unpack1("x2 a*") # => "T"
p Marshal.dump(false).unpack1("x2 a*") # => "F"...
...2

//emlist{
| len | n_1 | n_2 | n_3 | n_4 |
<-1-> <- len ->
byte bytes
//}

len の値は -4 -1, 1 4 で。符号と後続のデータが n1 n_len
まであることを示します。

//emlist[][ruby]{
def foo(len, n1, n2 = 0, n3 = 0, n4 = 0)
case len...
...り][ruby]{
class Foo < Array # (or String, Regexp, Hash)
def initialize(obj)
@foo = false
super(obj)
end
end
p Marshal.dump(Foo.new([true])).unpack("x2 a a a c a3 aca caca4 a")
# => ["I", "C", ":", 8, "Foo", "[", 6, "T", 6, ":", 9, "@foo", "F"]
//}

==== その他

実装上内部構造...

irb (60.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...ラインオプション

irb [options] file_name opts
options:
-f ~/.irbrc を読み込まない
-m bc モード (分数と行列の計算ができる)
-d $DEBUG を true にする (ruby -d と同じ)
-w ruby -w と同じ
-W[...
...:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME] = "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:MATH_MODE] = false
IRB.conf...
...] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true

それぞれの設定値の詳細については、IRB::Context を参照してください。

====...
...ります。

=== irb のコマンドラインオプション

irb [options] file_name opts
options:
-f ~/.irbrc を読み込まない
-d $DEBUG を true にする (ruby -d と同じ)
-w ruby -w と同じ
-W[level=2] ruby -W と同じ...
...EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME] = "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:USE_LOADER] = true
IRB...
....conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true

それぞれの設定値の詳細については、IRB::Context を参照してください。

====[a:customize_prompt] プロンプトのカスタマイズ

irb のプロンプトをカスタマイズしたい...

絞り込み条件を変える

<< 1 2 3 > >>