78件ヒット
[1-78件を表示]
(0.114秒)
別のキーワード
ライブラリ
- ビルトイン (23)
-
cgi
/ html (22) -
irb
/ output-method (22) - pp (11)
クラス
-
IRB
:: OutputMethod (22) - Method (12)
- PP (11)
-
RubyVM
:: InstructionSequence (11)
モジュール
-
CGI
:: HtmlExtension (22)
検索結果
先頭5件
-
IRB
:: OutputMethod # pp(*objs) -> object (21102.0) -
各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
Method
# <<(callable) -> Proc (21043.0) -
self と引数を合成した Proc を返します。
...ます。
Method#>> とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3......uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Method
# >>(callable) -> Proc (21043.0) -
self と引数を合成した Proc を返します。
...ます。
Method#<< とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3......uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = File.method(:read) >> WordScanner >> method(:pp)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
PP
# seplist(list , sep = lambda { comma _ breakable } , iter _ method = :each) {|e| . . . } -> () (17150.0) -
リストの各要素を何かで区切りつつ、自身に追加していくために使われます。
...ter_method によってイテレートし、各要素を引数としてブロックを実行します。
また、それぞれのブロックの実行の合間に sep が呼ばれます。
つまり、以下のふたつは同値です。
//emlist[][ruby]{
q.seplist([1,2,3]) {|v| q.pp v }
q.pp 1
q.......comma_breakable
q.pp 2
q.comma_breakable
q.pp 3
//}
@param list 自身に追加したい配列を与えます。iter_method を適切に指定すれば、
Enumerable でなくても構いません。
@param sep 区切りを自身に追加するブロックを与えます。list がイ......テレートされないなら、
sep は決して呼ばれません。
@param iter_method list をイテレートするメソッドをシンボルで与えます。
@see PP#comma_breakable... -
IRB
:: OutputMethod # ppx(prefix , *objs) -> object (9101.0) -
引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行 を出力します。
引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行
を出力します。
@param prefix 各 obj の先頭に追記する文字列を指定します。
@param objs 任意のオブジェクトを指定します。 -
CGI
:: HtmlExtension # form(method = "post" , action = nil , enctype = "application / x-www-form-urlencoded") -> String (235.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
...す。
@param method method 属性の値として "get" か "post" を指定します。
@param action action 属性の値を指定します。デフォルトは現在の CGI スクリプト名です。
@param enctype enctype 属性の値を指定します。デフォルトは "application/x-www-......ng" }
# <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get"){ "string" }
# <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get", "url"){ "string" }
# <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-f... -
CGI
:: HtmlExtension # form(method = "post" , action = nil , enctype = "application / x-www-form-urlencoded") { . . . } -> String (235.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
...す。
@param method method 属性の値として "get" か "post" を指定します。
@param action action 属性の値を指定します。デフォルトは現在の CGI スクリプト名です。
@param enctype enctype 属性の値を指定します。デフォルトは "application/x-www-......ng" }
# <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get"){ "string" }
# <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get", "url"){ "string" }
# <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-f... -
RubyVM
:: InstructionSequence # to _ a -> Array (19.0) -
self の情報を 14 要素の配列にして返します。
...いた場合は nil。
: #first_lineno
命令シーケンスの 1 行目の行番号。
: type
命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。
: locals
全ての引数名、ローカル変数......命令シーケンスを構成する命令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:a...