1018件ヒット
[1-100件を表示]
(0.169秒)
別のキーワード
ライブラリ
クラス
- Array (60)
- BasicObject (24)
- CSV (36)
-
CSV
:: Row (6) - Class (12)
- Data (6)
- Date (2)
- DateTime (2)
- Dir (12)
-
Encoding
:: InvalidByteSequenceError (12) - Enumerator (36)
- IO (12)
- Matrix (24)
- Method (12)
- Module (60)
-
Net
:: HTTP (108) - Object (120)
- OptionParser (36)
- Proc (7)
- Range (7)
- Regexp (48)
-
RubyVM
:: InstructionSequence (48) - 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)
モジュール
- Enumerable (48)
-
Rake
:: TaskManager (12)
キーワード
- != (12)
- << (19)
- === (31)
- =~ (12)
- [] (12)
-
absolute
_ path (24) -
add
_ row (12) -
alias
_ method (12) -
base
_ label (24) - broadcast (12)
- deconstruct (6)
-
deconstruct
_ keys (12) -
default
_ event _ sources (12) - deq (24)
- each (24)
-
each
_ with _ index (24) -
enum
_ for (24) -
error
_ bytes (12) -
eval
_ script (7) - fetch (36)
- get2 (24)
- handler= (12)
-
in
_ namespace (12) - inherited (12)
- initialize (12)
- inspect (12)
-
instruction
_ sequence (7) - label (12)
- match (24)
-
max
_ by (48) -
method
_ removed (12) - next (12)
-
on
_ head (12) -
on
_ tail (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)
- shift (24)
- signal (12)
-
singleton
_ method _ removed (12) -
source
_ location (12) -
to
_ enum (24) -
to
_ s (24) - unscan (12)
- upto (12)
-
with
_ object (24)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # base _ label -> String (32131.0) -
self が表す命令シーケンスの基本ラベルを返します。
...1:irb で実行した場合
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 "he......lo, 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::Instructio... -
RubyVM
:: InstructionSequence # label -> String (32131.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...rb で実行した場合
iseq = 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, wor......ld"
end
# irb
> iseq = RubyVM::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_la... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (32119.0) -
self が表す命令シーケンスの絶対パスを返します。
...irb で実行した場合
iseq = 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, wor......ld"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # path -> String (32119.0) -
self が表す命令シーケンスの相対パスを返します。
...irb で実行した場合
iseq = 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, wor......ld"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
CSV
# puts(row) -> self (15250.0) -
自身に row を追加します。
...自身に row を追加します。
データソースは書き込み用にオープンされていなければなりません。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値......列を指定][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")
# => id,first name,last na......me,age
# 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
CS... -
Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse (12349.0) -
HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。
...Net::HTTPResponse のインスタンスとして返します。
@param name リクエストのメソッド名を文字列で与えます。
@param path リクエストのパスを文字列で与えます。
@param data リクエストのボディを文字列で与えます。
@param header リク......エストのヘッダをハッシュで与えます。
//emlist[例][ruby]{
response = http.send_request('GET', '/index.html')
puts response.body
//}
@see Net::HTTP#request... -
Module
# prepend(*modules) -> self (12309.0) -
指定したモジュールを self の継承チェインの先頭に「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
...義されたメソッドは
override されます。
modules で指定したモジュールは後ろから順に処理されるため、
modules の先頭が最も優先されます。
また、継承によってこの「上書き」を処理するため、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 "X... -
Module
# prepended(class _ or _ module) -> () (12249.0) -
self が Module#prepend されたときに対象のクラスまたはモジュールを 引数にしてインタプリタがこのメソッドを呼び出します。
...repend されたときに対象のクラスまたはモジュールを
引数にしてインタプリタがこのメソッドを呼び出します。
@param class_or_module Module#prepend を実行したオブジェクト
//emlist[例][ruby]{
module A
def self.prepended(mod)
puts "#{self} pr......epended to #{mod}"
end
end
module Enumerable
prepend A
end
# => "A prepended to Enumerable"
//}
@see Module#included, Module#prepend, Module#prepend_features... -
Encoding
:: InvalidByteSequenceError # error _ bytes -> String (9137.0) -
エラー発生時に捨てられたバイト列を返します。
...st[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1\xFFdef")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
puts $!.error_bytes.dump #=> "\xA1"
puts $!.readagai......n_bytes.dump #=> "\xFF"
end
//}
@see Encoding::InvalidByteSequenceError#readagain_bytes...