るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.076秒)

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. class new
  5. argf.class to_a

ライブラリ

クラス

モジュール

キーワード

検索結果

WEBrick::HTTPUtils::FormData#list -> Array (18114.0)

自身が表す各フォームデータを収納した配列を生成して返します。

...自身が表す各フォームデータを収納した配列を生成して返します。

例:

require "webrick/cgi"
class
MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q'].list #=> ["val1", "val2", "val3"]
end
end
MyCGI.new.start()...

WEBrick::HTTPUtils::FormData#to_ary -> Array (3014.0)

自身が表す各フォームデータを収納した配列を生成して返します。

...自身が表す各フォームデータを収納した配列を生成して返します。

例:

require "webrick/cgi"
class
MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q'].list #=> ["val1", "val2", "val3"]
end
end
MyCGI.new.start()...

REXML::StreamListener#entitydecl(content) -> () (3007.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes'>
<!ENTITY WhatHeSa...
...l">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS

class
Listener
include REXML::StreamListener
def entitydecl(content); p content; end
end
REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["WhatHe...

Object#respond_to?(name, include_all = false) -> bool (43.0)

オブジェクトがメソッド name を持つとき真を返します。

...) を指定した事になります。

//emlist[][ruby]{
class
F
def hello
"Bonjour"
end
end

class
D
private
def hello
"Guten Tag"
end
end
list
= [F.new,D.new]

list
.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour

list
.each{|it| it.instance_eval("puts hello if it....
...ate_method
raise NotImplementedError.new
end

def finish
puts "finish"
end
end

class
ImplTemplateMethod
include Template
def template_method
"implement template_method"
end
end

class
NotImplTemplateMethod
include Template

# not implement template_method
end

puts ImplT...