別のキーワード
ライブラリ
クラス
- Array (21)
-
Gem
:: DependencyList (12) - Object (48)
-
RubyVM
:: InstructionSequence (36) - String (12)
モジュール
- Kernel (24)
キーワード
-
$ DEFAULT _ INPUT (12) -
$ LAST _ PAREN _ MATCH (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - === (12)
- Application (1)
- CSV (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 1 . 0 (4) - Observable (12)
-
Profiler
_ _ (6) -
base
_ label (12) - bigdecimal (12)
-
instance
_ of? (12) -
is
_ a? (12) -
kind
_ of? (12) - label (12)
-
net
/ smtp (12) - pack (21)
- pack テンプレート文字列 (12)
-
rb
_ time _ timespec _ new (10) - rdoc (12)
-
rdoc
/ markdown (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
spec
_ predecessors (12) -
test
/ unit (1) - unpack (12)
- xmlrpc (3)
- クラス/メソッドの定義 (12)
- パターンマッチ (12)
- 変数と定数 (4)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (18149.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...c
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::Instruct......b' }
# irb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb7... -
Object
# instance _ of?(klass) -> bool (6143.0) -
オブジェクトがクラス klass の直接のインスタンスである時真を返します。
...obj.instance_of?(c) が成立する時には、常に obj.kind_of?(c) も成立します。
@param klass Classかそのサブクラスのインスタンスです。
//emlist[][ruby]{
class C < Object
end
class S < C
end
obj = S.new
p obj.instance_of?(S) # true
p obj.instance_of?(C) #......false
//}
@see Object#kind_of?,Object#class... -
Profiler
_ _ (6006.0) -
プロファイラの実装です。 Profiler__.start_profile 実行から、Profiler__.stop_profile までの 区間の実行コードのプロファイルを取得します。
...ァイラの実装です。
Profiler__.start_profile 実行から、Profiler__.stop_profile までの
区間の実行コードのプロファイルを取得します。
以下の使用例を参照してください。
require 'profiler'
Profiler__.start_profile
require 'tk' # こ......のコードのプロファイルが測定される
Profiler__.print_profile(STDOUT)
# =>
% cumulative self self total
time seconds seconds calls ms/call ms/call name
51.64 1.10 1.10 3 366.67 776.67 Kernel.require
17.37......0.04 19 2.11 2.11 Module#private
1.41 2.16 0.03 29 1.03 1.38 Module#include
0.94 2.18 0.02 10 2.00 4.00 Module#module_function
0.94 2.20 0.02 2 10.00 10.00 Array#collect
:
:
<snip>... -
Object
# kind _ of?(mod) -> bool (3119.0) -
オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。
...です。
//emlist[][ruby]{
module M
end
class C < Object
include M
end
class S < C
end
obj = S.new
p obj.is_a?(S) # true
p obj.is_a?(C) # true
p obj.is_a?(Object) # true
p obj.is_a?(M) # true
p obj.is_a?(Hash) # false
//}
@see Object#instance_of?,Module#===,Object#class... -
ruby 1
. 8 . 4 feature (498.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...加
== 目次
* ((<ruby 1.8.4 feature/Ruby本体>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/super [bug]>))
* ((<ruby 1.8.4 feature/正規表現 [bug]>))
* ((<ruby 1.8.4 feature/シグナル [bug]>))
* ((<ruby 1.8.4 feature/......>))
* ((<ruby 1.8.4 feature/UnboundMethod#bind [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4......h too big (ArgumentError)
: Hash [bug]
#Wed Nov 23 03:40:49 2005 Guy Decoux <ts@moulon.inra.fr>
#
# * re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
# [ruby-core:06721]
sizeof(long) > sizeof(int) な環境で、ハッシュ関数のオーバー
フローのため... -
パターンマッチ (132.0)
-
パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples
...ase <expression>
in <pattern1>
...
in <pattern2>
...
in <pattern3>
...
else
...
end
in 節と when 節は1つの case 式の中に混ぜて書くことはできません。
『=>』 演算子と in 演算子で、単体の式で使用することも可能です。
<exp......ression> => <pattern>
<expression> in <pattern>
case/in 式は 「網羅的」 です。もし case 式の値がどの節にもマッチせず else 節がない場合、例外 NoMatchingPatternError が発生します。
そのため、条件付きのマッチや展開に case 式が使われ......する
puts "Connect with user '#{user}'"
in connection: {username: }
puts "Connect with user '#{username}'"
else
puts "Unrecognized structure of config"
end
# "Connect with user 'admin'" と出力
//}
一方、『=>』 演算子は、期待されるデータ構造があらかじめ分かっ... -
rdoc (114.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...のみが
処理されます。
===[a:usage] 使いかた
RDoc はコマンドラインから以下のようにして起動します。
$ rdoc <options> [name...]
ファイルをパースし、そこに含まれている情報を集め、出力します。こうして
全ファイルに渡る......成します。デフォルトでは --ri を指定すると
~/.rdoc に出力されますが、--ri-site で $datadir/ri/<ver>/site
に、--ri-system で $datadir/ri/<ver>/system に出力されます。これらす
べてはうしろに指定した --op を上書きします。デフォル......指定します。デフォルトは rdoc です。
markdown、rd、rdoc、tomdoc のいずれかから選択できます。
: --root root
Root of the source tree documentation will be generated for. Set this
when building documentation outside the source directory. Default is
the curren... -
VALUE rb
_ time _ timespec _ new(const struct timespec *ts , int offset) (112.0) -
引数 ts、offset を元に Time オブジェクトを作成して返します。
...引数 ts、offset を元に Time オブジェクトを作成して返します。
@param ts timespec 構造体のポインタ
@param offset 協定世界時との時差(秒)。
-86400 < offset < 86400 の場合は指定した時差に、INT_MAX
を指定した場合は......地方時、INT_MAX-1 を指定した場合は UTC に
なります。
@raise ArgumentError offset に上述の範囲以外の値を指定した場合に発生し
ます。... -
パターンマッチ (96.0)
-
パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples
...マッチは in 演算子を用いて実装されており、単体の式や
<expression> in <pattern>
case 文の中で利用できます。
case <expression>
in <pattern1>
...
in <pattern2>
...
in <pattern3>
...
else
...
end
in 節と when 節は1つの case 式......する
puts "Connect with user '#{user}'"
in connection: {username: }
puts "Connect with user '#{username}'"
else
puts "Unrecognized structure of config"
end
# "Connect with user 'admin'" と出力
//}
一方、『in』 文は、期待されるデータ構造があらかじめ分かってい......た場合には、例外が発生する
puts "Connect with user '#{user}'"
# Connect with user 'admin'" と出力
//}
『<expression> in <pattern>』 は 『<expression>; in <pattern>; true; else false; end』 と等価です。
パターンにマッチするかどうかだけを知りたいとき... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (90.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への変更点(まとめ)/サポートプラットフォームの追加>))
...更点(まとめ)
* ((<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への変更点(......変更されました。((<ruby-dev:20358>))
* Proc.new およびブロック引数で与えられる Proc は
引数チェックがゆるい。break が例外になる。
Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (Argum...