別のキーワード
ライブラリ
- ビルトイン (615)
- delegate (12)
- erb (24)
-
fiddle
/ import (12) - forwardable (48)
- json (24)
- logger (1)
- monitor (12)
- observer (12)
- openssl (24)
- profiler (6)
- psych (12)
-
rdoc
/ context (24) -
rdoc
/ generator / darkfish (12) -
rdoc
/ generator / ri (12) -
rexml
/ document (24) -
rubygems
/ specification (24) -
shell
/ command-processor (6) - sync (6)
- thread (2)
- tracer (24)
-
webrick
/ httpauth / digestauth (12) - win32ole (36)
クラス
- BasicObject (84)
- Class (48)
- Data (18)
- ERB (24)
- File (12)
-
Gem
:: Specification (24) - Module (24)
- Object (168)
- Proc (19)
-
RDoc
:: Context (24) -
RDoc
:: Generator :: Darkfish (12) -
RDoc
:: Generator :: RI (12) -
REXML
:: Child (12) -
REXML
:: Parent (12) -
Shell
:: CommandProcessor (6) - Struct (4)
- Thread (24)
-
Thread
:: Backtrace :: Location (48) - Tracer (24)
- WIN32OLE (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (96)
-
Fiddle
:: Importer (12) - Forwardable (48)
- JSON (12)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (12)
- ObjectSpace (36)
キーワード
- ! (12)
- != (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (12)
- Application (1)
- BasicObject (12)
- Cipher (12)
- ConditionVariable (12)
- DelegateClass (12)
- DigestAuth (12)
- Location (12)
- Marshal フォーマット (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Observable (12)
-
Profiler
_ _ (6) - RSA (12)
- RegexpError (12)
- Ruby用語集 (12)
-
Sync
_ m (6) - [] (7)
-
_ dump (12) -
absolute
_ path (12) - allocate (12)
-
base
_ label (12) -
cgi
/ session (12) - clone (12)
-
create
_ id (12) -
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
default
_ event _ sources (12) - define (6)
-
define
_ finalizer (24) - delegate (12)
-
drb
/ extservm (12) -
drb
/ gw (12) - dup (12)
- fork (12)
-
from
_ yaml (12) - handler= (12)
-
initialize
_ classes _ and _ modules (12) -
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) -
initialize
_ methods _ etc (12) - inspect (24)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
irb
/ completion (12) - logger (12)
-
marshal
_ dump (12) - max (48)
-
method
_ missing (12) - min (48)
- new (124)
-
ole
_ activex _ initialize (12) - path (12)
-
rb
_ class _ initialize (12) -
rb
_ mod _ initialize (12) -
rb
_ obj _ call _ init (12) -
rb
_ thread _ initialize (12) - rdoc (12)
-
rdoc
/ generator / json _ index (12) -
rdoc
/ parser (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
set
_ get _ line _ procs (24) -
singleton
_ method (12) - start (12)
- struct (12)
-
to
_ json (12) -
to
_ s (24) - tsort (12)
-
undefine
_ finalizer (12) - yaml (12)
-
yaml
_ initialize (12) -
yaml
_ tag (12) - クラス/メソッドの定義 (12)
- セキュリティモデル (12)
- パターンマッチ (12)
- 演算子式 (12)
検索結果
先頭5件
-
Observable (12.0)
-
Observer パターンを提供するモジュールです。
...=== サンプルコード
require "observer"
class Ticker ### Periodically fetch a stock price.
include Observable
def initialize(symbol)
@symbol = symbol
end
def run
last_price = nil
loop do
price = Price.fetch(@symbol)
print "Curr......- 140).
def self.fetch(symbol)
60 + rand(80)
end
end
class Warner ### An abstract observer of Ticker objects.
def initialize(ticker, limit)
@limit = limit
ticker.add_observer(self)
end
end
class WarnLow < Warner
def update(time, price) #... -
Ruby用語集 (12.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...値を真偽値として用いる式。if、unless、while、until のあとなどに書かれる。
: 初期化
: initialize
オブジェクトが生成されるとき、initialize という名の private メソッドが
呼ばれる。このメソッドで行う処理をオブジェクトの... -
Thread
:: Backtrace :: Location (12.0) -
Ruby のフレームを表すクラスです。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}
例2の実行結果:
init.rb:4:in `initialize'
init.rb:8:in `new'
init.rb:8:in `<main>'
=== 参考... -
Thread
:: Backtrace :: Location # base _ label -> String (12.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
Thread
:: Backtrace :: Location # inspect -> String (12.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...st[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"... -
Thread
:: Backtrace :: Location # to _ s -> String (12.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
ruby 1
. 9 feature (12.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...: 文字列のハッシュに FNV-1a hash を使用するようになりました
: Regexp#initialize でリテラルの正規表現を変更できなくなりました
: $SAFE=4 では Regexp#initialize で taint でない正規表現を変更できなくなりました
: Dir で $SAFE のセ... -
セキュリティモデル (12.0)
-
セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。
...IO, File, FileTest のメソッド呼び出し
//emlist{
$ ruby -e '$SAFE = 1; open(ARGV[0])' hoge
-e:1:in `initialize': Insecure operation - initialize (SecurityError)
from -e:1
//}
* ファイルテスト演算子の使用、ファイルの更新時刻... -
BasicObject (6.0)
-
特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。
...。
真に必要な場合にだけ BasicObject から派生してください。
=== 例
//emlist[例][ruby]{
class Proxy < BasicObject
def initialize(target)
@target = target
end
def method_missing(message, *args)
@target.__send__(message, *args)
end
end
proxy = Proxy.new("1")...