るりまサーチ

最速Rubyリファレンスマニュアル検索!
247件ヒット [1-100件を表示] (0.166秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:LITERAL[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

<< 1 2 3 > >>

Psych::Nodes::Scalar::LITERAL -> Integer (24317.0)

literal style を表します。

...literal style を表します。

@see Psych::Nodes::Scalar.new,
Psych::Nodes::Scalar#style,
Psych::Handler#scalar...

String#-@ -> String | self (9218.0)

self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

...freeze されている文字列の場合、self を返します。
freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

//emlist[例][ruby]{
# frozen_string_literal: false

original_text = "text"
frozen_text = -original_text
froz...
...en_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text...
....equal?(frozen_text) # => true
//}

@see String#+@...

Rubyの起動 (6774.0)

Rubyの起動 * cmd_option * shebang

...Rubyの起動
* cmd_option
* shebang

R
ubyインタプリタの起動は以下の書式のコマンドラインにより行います。

r
uby [ option ...] [ -- ] [ programfile ] [ argument ...]

ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプシ...
...終りを明示するため
に使用できます。programfile は、Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。

programfile が `#!' で始まるファイルである場...
...ems rubygems (無効にするのはデバッグ専用、default: enabled)
* did_you_mean did_you_mean (default: enabled)
* rubyopt RUBYOPT 環境変数 (default: enabled)
* frozen-string-literal 全ての文字列リテラルをfreeze (default: disabled)
//}

: --di...
...//emlist{
* gems rubygems (無効にするのはデバッグ専用、default: enabled)
* did_you_mean did_you_mean (default: enabled)
* rubyopt RUBYOPT 環境変数 (default: enabled)
* frozen-string-literal 全ての文字列リテラルをfreeze (default: disa...
...* gems rubygems (無効にするのはデバッグ専用、default: enabled)
* error_highlight error_highlight (default: enabled)
* did_you_mean did_you_mean (default: enabled)
* rubyopt RUBYOPT 環境変数 (default: enabled)
* frozen-string-literal 全て...

Kernel.#proc { ... } -> Proc (6312.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...(Proc のインスタンス)
を生成して返します。Proc.new に近い働きをします。


また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecat...
...ed] = true のときに警告メッセージ
「warning: lambda without a literal block is deprecated; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &bloc...
...に振る舞う
ことを意図されているため、例外 LocalJumpError は発生しません。

//emlist[例][ruby]{
def foo
Proc.new { return }
end

foo.call
# => in `call': return from proc-closure (LocalJumpError)
//}

以下の表は、手続きオブジェクトの実行を上の例と...
...true のときに警告メッセージ
「warning: lambda without a literal block is deprecated; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
pr...

Psych::Handler#scalar(value, anchor, tag, plain, quoted, style) -> () (6230.0)

スカラー値を見付けたときに呼び出されます。

...に呼び出されます。

value にはスカラー値の文字列が渡されます。

anchor にはスカラー値に関連付けられた anchor の名前が文字列で渡されます。
anchor がない場合には nil が渡されます。

tag にはスカラー値に関連付けられた...
...r::PLAIN
* Psych::Nodes::Scalar::SINGLE_QUOTED
* Psych::Nodes::Scalar::DOUBLE_QUOTED
* Psych::Nodes::Scalar::LITERAL
* Psych::Nodes::Scalar::FOLDED

必要に応じてこのメソッドを override してください。

@param value スカラー値
@param anchor 関連付けられた anchor...
...@param tag タグ名
@param plain plain style であるかどうか
@param quoted quoted style であるかどうか
@param style スカラーのスタイル

=== 例

以下の YAML ドキュメントには多くのパターンのスカラーが含まれています。

-
--
-
!str "foo"
-
&a...

絞り込み条件を変える

Ruby用語集 (6226.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...Ruby用語集
A B C D E F G I J M N O R S Y

a ka sa ta na ha ma ya ra wa

=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。

参照:d:spec/literal#percent

: 0 オリジン
: zero-ba...
...sed
番号が 0 から始まること。

例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。

: 1 オリジン
: one-based
番号が 1 から始まること。

例えば、
エラ...
...の番号、
R
uby 2.7 で導入された番号指定ブロックパラメーター、
といったものは 1 オリジンである。

===[a:A] A

: AWK
テキスト処理に適したプログラミング言語。
名称は、開発者である Aho(エイホ)、Weinberger(ワインバ...

String#dedup -> String | self (6218.0)

self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

...freeze されている文字列の場合、self を返します。
freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

//emlist[例][ruby]{
# frozen_string_literal: false

original_text = "text"
frozen_text = -original_text
froz...
...en_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text...
....equal?(frozen_text) # => true
//}

@see String#+@...

リテラル (6186.0)

リテラル * num * string * backslash * exp * char * command * here * regexp * array * hash * range * symbol * percent

...リテラル
* num
* string
* backslash
* exp
* char
* command
* here
* regexp
* array
* hash
* range
* symbol
* percent

数字の1や文字列"hello world"のようにRubyのプログラムの中に直接
記述できる値の事をリテラルといいます。

===[a:n...
...: -123

符号つき整数

: 123.45

浮動小数点数。
.1 など "." で始まる浮動小数点数は許されなくなりました。0.1 と書く必
要があります。

: 1.2e-3

浮動小数点数
: 0xffff

16進整数
: 0b1011

2進整数
: 0377
: 0o377

8進整数
: 42r...
...: 3.14r

有理数。
ただし、誤解を招く恐れがあるため、6.022e+23r のような指数部に有理数リ
テラルを含む形式は指定できません。
: 42i
: 3.14i

複素数
: 42ri
: 3.14ri

虚数部が有理数の複素数

数値リテラルには、`_' を含...

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (6150.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

...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 semicol...
...べてより破壊的な作用をもつメソッド(例: tr と tr!)で使われます。

: /xxx/ !~ yyy

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


===[a:q] ?

: ?a

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

: def xx?

この場合の...
...: #! ruby -Ks

shebang。d:spec/rubycmd#shebangを参照。

: # coding: utf-8

マジックコメント。d:spec/m17n#magic_comment を参照。

: "a is #{a}"

d:spec/literal#exp
//emlist{
a = 10
p "a is #{a}" #=> "a is 10"
//}

: Range#each

説明文の中でのみ使われます。Ruby...

RubyVM::InstructionSequence.compile_option -> Hash (6112.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...][ruby]{
r
equire "pp"
pp RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trac...
...e_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

絞り込み条件を変える

ruby 1.8.4 feature (4500.0)

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

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

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...ある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更もこちら
* [change]: 変更されたクラス/メソッドなど(互換性のない変更)
* [obsolete]: 廃止された(される予定の)機能
* [platform]: 対応プラットフォ...
...((<ruby 1.8.4 feature/bccwin32 [bug]>))
* ((<ruby 1.8.4 feature/cygwin [bug]>))
* ((<ruby 1.8.4 feature/BeOS [bug]>))
* ((<ruby 1.8.4 feature/Sun [bug]>))
* ((<ruby 1.8.4 feature/IA64 [bug]>))

== Ruby本体

: Symbol [bug]

# * parse.y (dsym): prohibit empty symbol literal by interpol...
<< 1 2 3 > >>