373件ヒット
[1-100件を表示]
(0.258秒)
ライブラリ
- ビルトイン (169)
-
cgi
/ html (36) -
rexml
/ document (60) -
rubygems
/ package / tar _ header (12) - scanf (36)
- socket (60)
クラス
-
ARGF
. class (24) - Binding (7)
-
Gem
:: Package :: TarHeader (12) - IO (12)
- MatchData (4)
- Module (120)
-
REXML
:: Attribute (12) -
REXML
:: Attributes (12) -
REXML
:: Element (24) - Socket (24)
- String (20)
- Symbol (6)
- UDPSocket (36)
モジュール
-
CGI
:: HtmlExtension (36) - Kernel (12)
-
REXML
:: Namespace (12)
キーワード
-
alias
_ method (12) - base (12)
- bind (12)
- captures (2)
- connect (12)
- deconstruct (2)
-
deprecate
_ constant (12) -
inplace
_ mode (12) - namespace (12)
- prefix (36)
- prefixes (24)
- private (48)
- protected (36)
- public (12)
- putc (12)
- scanf (36)
- send (36)
-
source
_ location (7) -
start
_ with? (14)
検索結果
先頭5件
-
CGI
:: HtmlExtension # a(href = "") -> String (21457.0) -
a 要素を生成します。
...
a 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param href 文字列を指定します。属性をハッシュで指定することもできます。
例:
a("http://www.example.com") { "Example" }
# => "<A HRE......F=\"http://www.example.com\">Example</A>"
a("HREF" => "http://www.example.com", "TARGET" => "_top") { "Example" }
# => "<A HREF=\"http://www.example.com\" TARGET=\"_top\">Example</A>"... -
CGI
:: HtmlExtension # a(href = "") { . . . } -> String (21457.0) -
a 要素を生成します。
...
a 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param href 文字列を指定します。属性をハッシュで指定することもできます。
例:
a("http://www.example.com") { "Example" }
# => "<A HRE......F=\"http://www.example.com\">Example</A>"
a("HREF" => "http://www.example.com", "TARGET" => "_top") { "Example" }
# => "<A HREF=\"http://www.example.com\" TARGET=\"_top\">Example</A>"... -
String
# start _ with?(*prefixes) -> bool (21349.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...prefixes のいずれかであるとき true を返します。
@param prefixes パターンを表す文字列または正規表現 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str")......# => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefix, String#delete_prefix!... -
String
# scanf(format) -> Array (18291.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...字列を format に従って変
換し、そのオブジェクトの配列を返します。
format で指定した文字列が見つからない場合は空の配列を
生成して返します。
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]
ブロ......scanf を継続して実行し、順次
見つかった文字列を変換したオブジェクトの配列を引数に、ブロックを
実行します。このとき、ブロックの実行結果を要素とする配列を返します。
require 'scanf'
str = "123 0x45 678 0x90"
p str.scanf......4]]
formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。
require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret #=> [["123", nil], ["abc", 456], ["def", nil]]
@param format スキ... -
String
# scanf(format) {|*ary| . . . } -> Array (18291.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...字列を format に従って変
換し、そのオブジェクトの配列を返します。
format で指定した文字列が見つからない場合は空の配列を
生成して返します。
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]
ブロ......scanf を継続して実行し、順次
見つかった文字列を変換したオブジェクトの配列を引数に、ブロックを
実行します。このとき、ブロックの実行結果を要素とする配列を返します。
require 'scanf'
str = "123 0x45 678 0x90"
p str.scanf......4]]
formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。
require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret #=> [["123", nil], ["abc", 456], ["def", nil]]
@param format スキ... -
MatchData
# captures -> [String] (15327.0) -
$1, $2, ... を格納した配列を返します。
...す。
MatchData#to_a と異なり $& を要素に含みません。
グループにマッチした部分文字列がなければ対応する要素は nil になります。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures #......=> ["foo", "bar", nil]
//}
@see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects... -
Module
# protected(name) -> String | Symbol (12420.0) -
メソッドを protected に設定します。
...ッドを protected に設定します。
引数なしのときは今後このクラスまたはモジュール定義内で新規に定義さ
れるメソッドを protected に設定します。
引数が与えられた時には引数によって指定されたメソッドを protected
に設定......it を参照して下さい。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
@raise NameError 存在しないメソッド名を指定した場合に発生します。
@see Module#prote......cted_method_defined?... -
MatchData
# deconstruct -> [String] (12327.0) -
$1, $2, ... を格納した配列を返します。
...す。
MatchData#to_a と異なり $& を要素に含みません。
グループにマッチした部分文字列がなければ対応する要素は nil になります。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures #......=> ["foo", "bar", nil]
//}
@see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects... -
REXML
:: Attribute # prefix -> String (12326.0) -
属性の名前空間を返します。
...st[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "elns"
a = REXML::Attribute.new( "x", "y" )
p a.......prefix # -> ""
//}... -
REXML
:: Attributes # prefixes -> [String] (12326.0) -
self の中で宣言されている prefix の集合を 文字列の配列で返します。
...prefix の集合を
文字列の配列で返します。
self が属する要素より上位の要素で定義されているものは含みません。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://exa......mple.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []
//}... -
Module
# alias _ method(new , original) -> Symbol (12325.0) -
メソッドの別名を定義します。
...メソッドの別名を定義します。
//emlist[例][ruby]{
module Kernel
alias_method :hoge, :puts # => :hoge
alias_method "foo", :puts # => :foo
end
//}
alias との違いは以下の通りです。
* メソッド名は String または Symbol で指定します
* グローバル......@param new 新しいメソッド名。String または Symbol で指定します。
@param original 元のメソッド名。String または Symbol で指定します。
@return 作成したエイリアスのメソッド名を表す Symbol を返します。
@see d:spec/def#alias
//emlist[例]......[ruby]{
module Kernel
alias_method :foo, :puts
end
foo "bar" # bar
//}... -
Module
# alias _ method(new , original) -> self (12325.0) -
メソッドの別名を定義します。
...メソッドの別名を定義します。
//emlist[例][ruby]{
module Kernel
alias_method :hoge, :puts # => Kernel
end
//}
alias との違いは以下の通りです。
* メソッド名は String または Symbol で指定します
* グローバル変数の別名をつけることはで......aram new 新しいメソッド名。String または Symbol で指定します。
@param original 元のメソッド名。String または Symbol で指定します。
@return self を返します。
@see d:spec/def#alias
//emlist[例][ruby]{
module Kernel
alias_method :foo, :puts
end
foo "ba......r" # bar
//}... -
Module
# private(name) -> String | Symbol (12320.0) -
メソッドを private に設定します。
...メソッドを private に設定します。
引数なしのときは今後このクラスまたはモジュール定義内で新規に定義さ
れるメソッドを関数形式でだけ呼び出せるように(private)設定します。
引数が与えられた時には引数によって指定......ソッドを private に
設定します。
可視性については d:spec/def#limit を参照して下さい。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
@raise NameError 存在......//emlist[例][ruby]{
class Foo
def foo1() 1 end # デフォルトでは public
private # 可視性を private に変更
def foo2() 2 end # foo2 は private メソッド
end
foo = Foo.new
p foo.foo1 # => 1
p foo.foo2 # => private method `foo2' called f...