るりまサーチ

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

別のキーワード

  1. _builtin local_variables
  2. pp pretty_print_instance_variables
  3. win32ole variables
  4. kernel local_variables
  5. module class_variables

種類

ライブラリ

クラス

キーワード

検索結果

Object::DATA -> File (18209.0)

スクリプトの __END__ プログラムの終り以降をアクセスする File オブジェクト。

...んでおくことができます。
DATA
定数はそのデータ部分にアクセスするための File オブジェクトを保持しています。

__END__ を含まないプログラムにおいては DATA は定義されません。

=== 注意

* DATA.rewind で移動する読みとり...
...ec/variables#pseudo)
ではなく実行されたファイル ($0) を指します。

=== 例1
print DATA.gets # => 故人西辞黄鶴楼
print DATA.gets # => 烟花三月下揚州
print DATA.gets # => 孤帆遠影碧空尽
print DATA.gets # => 唯見長江天際流
DATA
.ge...
...江天際流

=== 例2
sum = 0
DATA
.each_line do |line|
sum += line.to_i
end

DATA
.rewind
p DATA.gets # => "sum = 0¥n"

__END__
17
19
23
29
31

=== 例3
DATA
.gets # => uninitialized constant DATA (NameError)

=== 例4

ファイル...

NEWS for Ruby 3.0.0 (60.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...2.7.2).
Turn them on with `-W:deprecated` (or with `-w` to show other warnings too).
16345
* `$SAFE` and `$KCODE` are now normal global variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class definitions in me...
...*
* Can be sliced with Enumerator::ArithmeticSequence

//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}

* Binding
* Binding#eval when called with one argument will use `"(...
...r a bitmap image, between extension libraries. The extension libraries can share also the metadata of the memory area that consists of the shape, the element format, and so on. Using these kinds of metadata, the extension libraries can share even a multidimensional array appropriately. This feature...

Ruby用語集 (36.0)

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

...。そうでない場所では、メソッドを使って
間接的に参照・代入できる。

→アクセッサー

参照:d:spec/variables#instance

: インスタンスメソッド
: instance method
クラスやモジュールに定義されるメソッドは、定義方法によ...
...タンスメソッドの定義中
でも参照・代入できる。

クラスインスタンス変数とは異なる。

参照:d:spec/variables#class

: クラス名
: class name
クラスの名前。クラスを定義すると、同名の定数が定義され、そのクラスが
...
...ースト
: test-first programming
テスト駆動開発において、まず最初にテストコードを記述すること。

: データ型
: data type
一般には「データがどのようなものであるか」というデータの種類をいう。
プログラミング言語によ...

NEWS for Ruby 2.0.0 (30.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...を導入しました。期待しないスタックオーバーフローを避けるためです

* GC::Profiler
* 追加: GC::Profiler.raw_data GCの加工していないプロファイルデータを返します

* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。A...
...カルな変数を取得します
(these are different than Fiber local variables).
* 追加: Thread#thread_variable_set スレッドローカルな変数をセットします
* 追加: Thread#thread_variables スレッドローカルな変数の名前のリストを取得します...
...o adapt to situations where FIPS mode would be an
explicit requirement.
* Authenticated Encryption with Associated Data (AEAD) is supported via
Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=.
Currently (OpenSSL 1.0.1c), only GCM mode is supported.

* ostruct
* 追...

ERB.new(str, safe_level=NOT_GIVEN, trim_mode=NOT_GIVEN, eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout') -> ERB (24.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...れました。
trim_mode と eoutvar の指定はキーワード引数に移行してください。

//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",...
...= "", price = "" )
@product = product
@price = price
end

def build
b = binding
# create and run templates, filling member data variables
ERB.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PRODUCT
ERB.n...
...utvar: "@price").result b
<%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
<%= PRODUCT[:desc] %>
END_PRICE
end
end

# setup template data
listings = Listings.new
listings.build

puts listings.product + "\n" + listings.price

# Chicken Fried Steak
# A well messages pattie, breaded and...

絞り込み条件を変える

ERB.new(str, safe_level=nil, trim_mode=nil, eoutvar=&#39;_erbout&#39;) -> ERB (24.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...れました。
trim_mode と eoutvar の指定はキーワード引数に移行してください。

//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",...
...= "", price = "" )
@product = product
@price = price
end

def build
b = binding
# create and run templates, filling member data variables
ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PR...
...0, "", "@price").result b
<%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
<%= PRODUCT[:desc] %>
END_PRICE
end
end

# setup template data
listings = Listings.new
listings.build

puts listings.product + "\n" + listings.price

# Chicken Fried Steak
# A well messages pattie, breaded and...

ERB.new(str, trim_mode: nil, eoutvar: &#39;_erbout&#39;) -> ERB (24.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...B を使うときに変更
します。通常は指定する必要はありません。


//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",...
...= "", price = "" )
@product = product
@price = price
end

def build
b = binding
# create and run templates, filling member data variables
ERB.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END_PRODUCT
ERB.n...
...utvar: "@price").result b
<%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
<%= PRODUCT[:desc] %>
END_PRICE
end
end

# setup template data
listings = Listings.new
listings.build

puts listings.product + "\n" + listings.price

# Chicken Fried Steak
# A well messages pattie, breaded and...