84件ヒット
[1-84件を表示]
(0.182秒)
ライブラリ
- ビルトイン (12)
-
cgi
/ core (12) - erb (24)
-
irb
/ output-method (36)
クラス
- CGI (12)
- ERB (24)
-
IRB
:: OutputMethod (24) -
IRB
:: StdioOutputMethod (12) - Module (12)
キーワード
-
def
_ class (12) -
def
_ module (12) - header (12)
-
instance
_ method (12) - printn (12)
検索結果
先頭5件
-
IRB
:: OutputMethod # print(*objs) (27202.0) -
NotImplementedError が発生します。
...NotImplementedError が発生します。
@param objs 任意のオブジェクトを指定します。
@raise NotImplementedError 必ず発生します。... -
IRB
:: StdioOutputMethod # print(*objs) -> nil (27202.0) -
引数を標準出力に出力します。
引数を標準出力に出力します。
@param objs 任意のオブジェクトを指定します。 -
IRB
:: OutputMethod # printn(*objs) -> nil (15201.0) -
各 obj を self に出力し、最後に改行を出力します。
各 obj を self に出力し、最後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
Module
# instance _ method(name) -> UnboundMethod (12362.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...nboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Interpreter
d......) print "there, "; end
def do_d() print "Hello "; end
def do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret......(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}... -
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (207.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...スのスーパークラス
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
class MyClass_
def initialize(arg1, arg2)
@arg1 = arg1; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtml
erb = ERB.new(File.read(filenam......e))
erb.filename = filename
MyClass = erb.def_class(MyClass_, 'render()')
print MyClass.new('foo', 123).render()
# => test1foo
# test2123
//}... -
ERB
# def _ module(methodname=& # 39;erb& # 39;) -> Module (207.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
...am methodname メソッド名
//emlist[例][ruby]{
require 'erb'
filename = 'example.rhtml'
erb = ERB.new("test1<%= arg1 %>\ntest2<%= arg2 %>\n")
erb.filename = filename
MyModule = erb.def_module('render(arg1, arg2)')
class MyClass
include MyModule
end
print MyClass.new.render('foo', 123)
# test1......foo
# test2123
//}... -
CGI
# header(options = "text / html") -> String (137.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。
CGI#out を使わずに自力で HTML を出力したい場合などに使います。
このメソッドは文字列エンコーディングを変換しません。
ヘッダのキ......。
: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、
Date ヘ......ッダをセットします。また Server と Connection の各ヘッダにもデフォルト値をセットします。
偽を指定する場合は、これらの値を明示的にセットしてください。
: status
HTTP のステータスコードを指定します。
このリスト...