1285件ヒット
[1-100件を表示]
(0.112秒)
別のキーワード
ライブラリ
クラス
- Array (60)
- BasicObject (60)
- CSV (36)
-
CSV
:: Row (6) - Class (12)
- Data (6)
- Date (2)
- DateTime (2)
- Dir (12)
-
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Enumerator (36)
-
File
:: Stat (60) - IO (12)
- Matrix (24)
- Method (24)
- Module (99)
-
Net
:: HTTP (108) - Object (132)
- OptionParser (72)
- Proc (7)
-
Rake
:: Application (12) - Range (7)
- Regexp (60)
-
RubyVM
:: InstructionSequence (48) - SignalException (12)
- String (12)
- StringScanner (60)
- Thread (12)
-
Thread
:: Backtrace :: Location (48) -
Thread
:: ConditionVariable (24) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - Time (2)
- TracePoint (14)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12) -
Zlib
:: GzipWriter (24)
モジュール
- Enumerable (48)
-
Rake
:: TaskManager (12)
キーワード
- ! (12)
- != (12)
- << (19)
- === (31)
- =~ (12)
- [] (12)
-
absolute
_ path (24) -
add
_ row (12) -
alias
_ method (12) -
base
_ label (24) - blockdev? (12)
- broadcast (12)
- chardev? (12)
- close (12)
-
const
_ added (3) - deconstruct (6)
-
deconstruct
_ keys (12) -
default
_ event _ sources (12) - deq (24)
- each (24)
-
each
_ with _ index (24) -
enum
_ for (24) -
error
_ bytes (12) -
error
_ char (12) -
eval
_ script (7) - fetch (36)
- finish (12)
- get2 (24)
- handler= (12)
- help (12)
-
in
_ namespace (12) - inherited (12)
- initialize (12)
-
initialize
_ copy (12) - inspect (12)
-
instruction
_ sequence (7) - label (12)
- match (24)
-
max
_ by (48) -
method
_ added (12) -
method
_ removed (12) -
method
_ undefined (12) - next (12)
-
on
_ head (12) -
on
_ tail (12) - owner (12)
- path (12)
- peek (12)
- peep (12)
- pid (12)
- pointer= (12)
- pop (24)
- pos= (12)
- post2 (24)
- prepend (12)
- prepended (12)
-
public
_ send (24) - read (12)
- refine (12)
-
request
_ get (24) -
request
_ post (24) -
respond
_ to? (12) -
send
_ request (12) - separator (12)
- setgid? (12)
- setuid? (12)
- shift (24)
- signal (12)
- signm (12)
-
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
source
_ location (12) - sticky? (12)
-
to
_ enum (24) -
to
_ s (36) -
top
_ level (12) -
undef
_ method (12) - unscan (12)
- upto (12)
- ver (12)
-
with
_ object (24) - ~ (12)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # base _ label -> String (26025.0) -
self が表す命令シーケンスの基本ラベルを返します。
...iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb......> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
RubyVM
:: InstructionSequence # label -> String (26025.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
... RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_label... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (26013.0) -
self が表す命令シーケンスの絶対パスを返します。
...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # path -> String (26013.0) -
self が表す命令シーケンスの相対パスを返します。
...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
CSV
# puts(row) -> self (15144.0) -
自身に row を追加します。
...。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
CSV.open("test.csv", "a") do |csv|
csv.puts(["5", "saburo", "kondo", "34"])
end
print File.read("test.csv")
# =>......e
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
CSV... -
Module
# prepend(*modules) -> self (6197.0) -
指定したモジュールを self の継承チェインの先頭に「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
...を処理するため、prependの引数として
渡したモジュールのインスタンスメソッドでsuperを呼ぶことで
self のモジュール/クラスのメソッドを呼び出すことができます。
実際の処理は modules の各要素の prepend_features を後ろから......けです。
Module#prepend_features が継承チェインの改変を実行し、結果として上のような
処理が実現されます。そのため、prepend_features を override することで
prepend の処理を追加/変更できます。
@param modules prepend する Module を指......します
@see Module#prepend_features, Module#prepended
//emlist[例][ruby]{
# super と prepend の組み合わせの例
module X
def foo
puts "X1" # (1x)
super # (2x)
puts "X2" # (3x)
end
end
class A
prepend X
def foo
puts "A" #(1a)
end
end
A.new.foo
# (1x) (2x)(こ... -
Module
# prepended(class _ or _ module) -> () (6137.0) -
self が Module#prepend されたときに対象のクラスまたはモジュールを 引数にしてインタプリタがこのメソッドを呼び出します。
...ule#prepend されたときに対象のクラスまたはモジュールを
引数にしてインタプリタがこのメソッドを呼び出します。
@param class_or_module Module#prepend を実行したオブジェクト
//emlist[例][ruby]{
module A
def self.prepended(mod)
puts "#{sel......f} prepended to #{mod}"
end
end
module Enumerable
prepend A
end
# => "A prepended to Enumerable"
//}
@see Module#included, Module#prepend, Module#prepend_features... -
Object
# public _ send(name , *args) -> object (6131.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...の実行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
//emlist[][ruby]{
1.public_send(:+, 2) # => 3
//}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引......しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send... -
Object
# public _ send(name , *args) { . . . . } -> object (6131.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...の実行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
//emlist[][ruby]{
1.public_send(:+, 2) # => 3
//}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引......しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send...