別のキーワード
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Numeric (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
-
irb
/ completion (11) -
rdoc
/ parser / ruby (11) -
ruby 1
. 8 . 3 feature (11) - クラス/メソッドの定義 (11)
検索結果
-
Singleton (38058.0)
-
Singleton パターンを提供するモジュールです。
...Singleton パターンを提供するモジュールです。
Mix-in により singleton パターンを提供します。
Singleton モジュールを include することにより、クラスは
高々ひとつのインスタンスしか持たないことが保証されます。
Singleton を M......す。
=== サンプルコード
require 'singleton'
class SomeSingletonClass
include Singleton
#....
end
a = SomeSingletonClass.instance
b = SomeSingletonClass.instance # a and b are same object
p [a,b] # => [#<SomeSingletonClass:0x0000562e6e18ddd0>, #<SomeSingletonClass:0x00......00562e6e18ddd0>]
a = SomeSingletonClass.new # => NoMethodError (private method `new' called for SomeSingletonClass:Class)... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (738.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...ことを意味する
ようになります。((<ruby-dev:20358>))
: defined? [compat]
属性代入、配列要素への代入に対して "method" でなく "assignment" を返
すようになりました。
: ((<リテラル/数値リテラル>)) [compat]
10進((*整数*))リテラル......$! と rescue 節の例外クラスとは ((<Module#===|Module/===>))
を使って比較するようになりました。
以前は kind_of? による比較なので基本的な動作に変わりはありませんが、
SystemCallError.=== は特別に errno が一致する例外を同じと......te method になります。
: ((<Object#instance_variable_get|Object/instance_variable_get>)) [new]
: ((<Object#instance_variable_set|Object/instance_variable_set>)) [new]
追加
: ((<Object#object_id|Object/object_id>)) [new]
追加 (Object#id は、obsolete)
: ((<Object#singleton_method_... -
ruby 1
. 8 . 3 feature (366.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...http://dev.ctor.org/soap4r/wiki/Changes-154>))
* ((<URL:http://dev.ctor.org/soap4r/wiki/Changes-155>))
== 1.8.2 (2004-12-25) -> 1.8.3 (2005-09-21)
=== 2005-09-19
: FileUtils.remove_entry_secure [lib] [new]
: FileUtils.remove_entry [lib] [new]
: FileUtils.chmod_R [lib] [new]
: F......eUtils.options [lib] [new]
: FileUtils.have_option? [lib] [new]
: FileUtils.options_of [lib] [new]
: FileUtils.collect_method [lib] [new]
追加。
: FileUtils.rm_r [lib] [compat]
: FileUtils.rm_rf [lib] [compat]
: FileUtils.cd [lib] [compat]
: FileUtils.cp_r......した。((<ruby-core:4663>))
=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::Encoding#encode_sjis [lib] [bug]
decode_sjis と encode_sjis が
逆に定義されていたバグを修正しました。((<ruby-core:4772>))
=== 2005-05-16
: singleton class [ruby] [change]
特... -
クラス/メソッドの定義 (250.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] クラス定義
//emlist[例]......義式は、最後に評価した式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:singleton_class] 特異クラス定義
//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end
# ...
end......ス定義式は、最後に評価した式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:module] モジュール定義
//emlist[例][ruby]{
module Foo
def test
# ...
end
# ...
end
//}
文法:
module 識別子... -
NEWS for Ruby 3
. 0 . 0 (168.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern......variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJ......== Command line options
=== `--help` option
When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` opti... -
rdoc
/ parser / ruby (132.0) -
Ruby のソースコードを解析するためのサブライブラリです。
...る事ができます。
=== メタプログラミングされたメソッド
動的に定義されたメソッドをドキュメントに含めたい場合、## でコメントを開始します。
##
# This is a meta-programmed method!
add_my_method :meta_method, :arg1, :arg2
RDoc::Pars......method ようにメソッドの定義を行
うような識別子の後に続くトークンをメソッド名として解釈します。メソッド
名が見つからなかった場合、警告が表示されます。また、この場合はメソッド
名は 'unknown' になります。
:method......ます。
##
# :method: woo_hoo!
デフォルトでは動的に定義されたメソッドはインスタンスメソッドとして解析
されます。特異メソッドとしたい場合は、:singleton-method: 命令を指定しま
す。
##
# :singleton-method:
以下のように... -
NEWS for Ruby 2
. 1 . 0 (126.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...れた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.0.0 以降の変更
=== 言語仕様の変更
* キーワード引数のデフォルト値が省略可能になりました。これらの「必須キーワード引......した
* Kernel
* 追加: Kernel#singleton_method(Object#singleton_method)
* Module
* 追加: Module#using, which activates refinements of the specified module only
in the current class or module definition.
* 追加: Module#singleton_class? レシーバーが特異クラス......el
* main.using はもはや実験的な機能ではありません。
The method activates refinements in the ancestors of the argument module to
support refinement inheritance by Module#include
=== 組み込みクラスの互換性 (機能追加とバグ修正を除く)
* Hash... -
Ruby用語集 (114.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......ty
メソッドやそれをオブジェクト化した Method オブジェクトの仮引数の数、および
ブロックやそれをオブジェクト化した Proc オブジェクトの
ブロックパラメーターの数。
Method#arity や Proc#arity で得ることができる。......: 特異クラス
: singleton class
すべてのオブジェクトには自身が属すクラスとは別に、オブジェクト固有の
クラスがあり、特異クラスと呼ばれる。
参照:Object#singleton_class
: 特異メソッド
: singleton method
オブジェクト固... -
NEWS for Ruby 2
. 7 . 0 (102.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0,......示され、Ruby 3.2 で削除される
予定です。 16131
* Object#methodとModule#instance_methodがrefinementsを考慮するようになりました。 15373
=== コマンドラインオプション
==== 警告オプション
カテゴリ化された警告を管理するために「......i
* delegate
* getoptlong
* net-pop
* net-smtp
* open3
* pstore
* readline
* readline-ext
* singleton
* 以下のdefault gemはruby-coreでの変更のみで、まだrubygems.orgでは公開されていません。
* monitor
* obs... -
NEWS for Ruby 2
. 3 . 0 (90.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...れた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.2.0 以降の変更
=== 言語仕様の変更
* frozen-string-literal プラグマ:
* 実験的な機能として fronzen-string-literal というプラグマが......n gem:
* 名前のタイポによって NameError や NoMethodError が起きたときに、自動的に他の似た名前を提案してくれます。
//emlist{
"Yuki".starts_with?("Y")
# => NoMethodError: undefined method `starts_with?' for "Yuki":String
# Did you mean?......ると例外が発生するようになりました。
11444
* Module
* Module#define_method と Object#define_singleton_method は
メソッド本体(Procオブジェクト、Methodオブジェクト、またはブロック )が必須になりました。
ブロックが与... -
NEWS for Ruby 2
. 0 . 0 (72.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...れた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%......追加(実験的): Module#refine, スコープを限定してクラスやモジュールを拡張します。
* 拡張: Module#define_method は UnboundMethod を受け付けるようになりました
* 拡張: Module#const_get 修飾された定数名の文字列を受け付けるように......た名前がスレッドローカルな変数であるかどうか返します
* 追加: Thread.handle_interrupt as well as instance and singleton methods
Thread.pending_interrupt? for asynchronous handling of exceptions
* 追加: Thread#backtrace_locations Kernel#caller_locations に...