別のキーワード
種類
- インスタンスメソッド (60)
- 特異メソッド (36)
- 文書 (24)
- 定数 (24)
ライブラリ
- ビルトイン (72)
-
irb
/ ext / save-history (24) - socket (24)
モジュール
-
IRB
:: HistorySavingAbility (12) -
Socket
:: Constants (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
IP
_ RECVERR (24) - compile (12)
- extend (12)
-
extend
_ object (12) -
init
_ save _ history (12) - new (12)
-
ruby 1
. 6 feature (12) - strftime (12)
検索結果
先頭5件
-
Module
# extended(obj) -> () (18119.0) -
self が他のオブジェクト に Object#extend されたときに 呼ばれます。引数には extend を行ったオブジェクトが渡されます。
...行ったオブジェクトが渡されます。
@param obj Object#extend を行ったオブジェクト
//emlist[例][ruby]{
module Foo
def self.extended(obj)
p "#{obj} extend #{self}"
end
end
Object.new.extend Foo
# => "#<Object:0x401cbc3c> extend Foo"
//}
@see Module#extend_object... -
IRB
:: HistorySavingAbility . extended(obj) -> object (18107.0) -
obj に irb のヒストリの読み込み、保存の機能を提供します。
...obj に irb のヒストリの読み込み、保存の機能を提供します。
obj を返します。
@param obj IRB::HistorySavingAbility を extend したオブジェクトです。... -
Time
# strftime(format) -> String (96.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...時刻を format 文字列に従って文字列に変換した結果を返します。
@param format フォーマット文字列を指定します。使用できるものは 以下の通りです。
* %A: 曜日の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月......d") # => 20010203 Calendar date (basic)
p t.strftime("%F") # => 2001-02-03 Calendar date (extended)
p t.strftime("%Y-%m") # => 2001-02 Calendar date, reduced accuracy, specific month
p t.strftime("%Y")......Y-%j") # => 2001-034 Ordinal date (extended)
p t.strftime("%GW%V%u") # => 2001W056 Week date (basic)
p t.strftime("%G-W%V-%u") # => 2001-W05-6 Week date (extended)
p t.strftime("%GW%V") # => 2001W05... -
ruby 1
. 6 feature (60.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...>))
Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
=> -:2:in `remove_instance_variable': instance variable @foo not defined (NameError)
ruby 1.6.7 (2002-04-10) [i586-linux]
:......わることはなくなりました。((<ruby-dev:17876>))
class Foo
FOO = 1
@@foo = 1
end
FOO = 2
@@foo = 2
Foo.module_eval { p FOO, @@foo }
=> ruby 1.6.7 (2002-03-01) [i586-linux]
1
1
=> ruby 1.......for 1) (ArgumentError)
from /usr/lib/ruby/1.6/mutex_m.rb:104:in `initialize'
from /usr/lib/ruby/1.6/mutex_m.rb:50:in `mu_extended'
from /usr/lib/ruby/1.6/mutex_m.rb:34:in `extend_object'
from -e:1:in `extend'
from -e:1
: $SAFE / ((<load|... -
Module
# extend _ object(obj) -> object (36.0) -
Object#extend の実体です。オブジェクトにモジュールの機能を追加します。
...les)
modules.reverse_each do |mod|
# extend_object や extended はプライベートメソッドなので
# 直接 mod.extend_object(self) などとは書けない
mod.__send__(:extend_object, self)
mod.__send__(:extended, self)
end
end
//}
extend_object のデフォルトの......では、self に定義されて
いるインスタンスメソッドを obj の特異メソッドとして追加します。
@param obj self の機能を追加するオブジェクトを指定します。
@return obj で指定されたオブジェクトを返します。
@see Module#extended... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (36.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...て返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以......IGNORECASE の指定と同じになります。
@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイ......=> "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (36.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...て返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以......IGNORECASE の指定と同じになります。
@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイ......=> "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2... -
Object
# extend(*modules) -> self (30.0) -
引数で指定したモジュールのインスタンスメソッドを self の特異 メソッドとして追加します。
...複数のモジュールを指定した場合、最後
の引数から逆順に extend を行います。
@param modules モジュールを任意個指定します(クラスは不可)。
@return self を返します。
//emlist[][ruby]{
module Foo
def a
'ok Foo'
end
end
module Bar
d......ただしその場合、フック用のメソッド
が Module#extended ではなく Module#included になるという違いがあります。
//emlist[][ruby]{
# obj.extend Foo, Bar とほぼ同じ
class << obj
include Foo, Bar
end
//}
@see Module#extend_object,Module#include,Module#extended... -
Regexp
. compile(string , option = nil) -> Regexp (30.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...複製して返します。第二引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以......指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.co......=> "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2... -
Regexp
. new(string , option = nil) -> Regexp (30.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...複製して返します。第二引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以......指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.co......=> "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2... -
Socket
:: Constants :: IP _ RECVERR -> Integer (22.0) -
Enable extended reliable error message passing。 BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
...Enable extended reliable error message passing。
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IP, ip(4freebsd)...