228件ヒット
[201-228件を表示]
(0.124秒)
別のキーワード
クラス
- ERB (36)
- Method (12)
-
Net
:: HTTPGenericRequest (12) -
RubyVM
:: InstructionSequence (24) - UnboundMethod (12)
-
WIN32OLE
_ TYPE (12)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) -
Net
:: HTTPHeader (12)
キーワード
-
def
_ class (12) -
def
_ method (12) -
def
_ module (12) -
default
_ event _ sources (12) -
first
_ lineno (12) -
source
_ location (24) -
to
_ a (12) -
to
_ json (108)
検索結果
先頭3件
-
RubyVM
:: InstructionSequence # first _ lineno -> Integer (9119.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
...の 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2... -
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (229.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
@param superklass 無名クラスのスーパークラス
@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(filename))
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 (229.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
...変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
@param 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)
# test1foo
# test2123
//}...