別のキーワード
ライブラリ
- ビルトイン (2587)
- csv (63)
- digest (24)
- erb (24)
- fiber (8)
-
fiddle
/ import (12) -
irb
/ cmd / help (12) -
irb
/ cmd / load (36) - json (36)
-
json
/ add / exception (12) -
net
/ http (72) - openssl (12)
- optparse (60)
- pp (24)
- prime (24)
- rake (180)
-
rake
/ packagetask (60) -
rexml
/ document (24) - strscan (48)
- thread (16)
- win32ole (36)
- zlib (24)
クラス
-
ARGF
. class (12) - Array (125)
- BasicObject (96)
- Binding (36)
- CSV (60)
-
CSV
:: Row (3) - Class (12)
- Data (3)
-
Digest
:: Base (24) - ERB (24)
-
Encoding
:: Converter (48) -
Encoding
:: InvalidByteSequenceError (24) - Enumerator (96)
-
Enumerator
:: Lazy (24) -
Enumerator
:: Yielder (24) - Exception (68)
- Fiber (42)
-
File
:: Stat (12) - FrozenError (6)
- Hash (48)
- IO (32)
-
IRB
:: ExtendCommand :: Help (12) -
IRB
:: ExtendCommand :: Load (12) -
IRB
:: ExtendCommand :: Require (12) -
IRB
:: ExtendCommand :: Source (12) - Integer (12)
-
JSON
:: Parser (12) -
JSON
:: State (12) - MatchData (20)
- Method (128)
- Module (436)
- Mutex (2)
-
Net
:: HTTP (24) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (24) - Numeric (62)
- Object (348)
- OptionParser (60)
- Prime (24)
-
REXML
:: Attributes (24) -
Rake
:: FileList (108) -
Rake
:: FileTask (12) -
Rake
:: InvocationChain (24) -
Rake
:: PackageTask (60) -
Rake
:: TaskArguments (12) - Range (96)
- Regexp (36)
-
RubyVM
:: InstructionSequence (60) - String (121)
- StringScanner (48)
- Symbol (6)
- Thread (84)
-
Thread
:: Backtrace :: Location (48) -
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (20) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - TracePoint (122)
- UnboundMethod (24)
- UncaughtThrowError (22)
- WIN32OLE (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12) -
Zlib
:: GzipWriter (24)
モジュール
- Comparable (12)
- Enumerable (196)
-
Fiddle
:: Importer (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
Rake
:: Cloneable (24)
キーワード
- != (12)
- % (12)
- < (12)
- << (19)
- <= (12)
- == (60)
- === (44)
- > (12)
- >= (12)
- >> (7)
- [] (60)
- []= (24)
-
_ _ send _ _ (24) -
_ dump (12) -
absolute
_ path (24) -
add
_ trace _ func (12) -
alias
_ method (4) - append (12)
-
append
_ as _ bytes (1) - arity (24)
- at (12)
- attr (12)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) - backtrace (24)
-
backtrace
_ locations (12) -
base
_ label (24) - begin (24)
- bind (12)
- binding (12)
-
body
_ stream (12) -
body
_ stream= (12) - broadcast (12)
- byteend (2)
- byteoffset (6)
- call (24)
-
callee
_ id (12) - chardev? (12)
-
check
_ circular? (12) - chunk (12)
- clamp (12)
-
class
_ eval (12) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (24)
- close (12)
- compact (4)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
- curry (22)
- deconstruct (6)
-
def
_ class (12) -
def
_ module (12) -
default
_ event _ sources (12) - deq (24)
- disable (24)
- dup (12)
- each (84)
-
each
_ attribute (12) -
each
_ byte (36) -
each
_ entry (24) -
each
_ with _ index (24) - enable (24)
-
end
_ with? (12) -
enum
_ for (36) - eql? (12)
-
error
_ bytes (12) - eval (12)
- event (12)
-
excluded
_ from _ list? (12) - execute (48)
- feed (12)
- fetch (36)
-
field
_ size _ limit (12) - finish (12)
- first (24)
-
first
_ lineno (12) -
force
_ quotes? (12) - get (12)
- gsub! (12)
- handler= (12)
- hexdigest (12)
-
incomplete
_ input? (12) - inherited (12)
- initialize (12)
- inspect (42)
-
instance
_ eval (12) -
instance
_ exec (12) -
instance
_ methods (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instruction
_ sequence (7) - invert (12)
-
is
_ a? (12) -
kind
_ of? (12) - label (12)
- last (24)
- lazy (12)
- load (12)
-
local
_ variable _ get (12) -
local
_ variable _ set (12) -
marshal
_ dump (12) - match (24)
- match? (12)
-
matched
_ size (12) - max (24)
-
max
_ by (48) - member? (12)
- merge (24)
-
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) - methods (12)
- min (24)
-
module
_ eval (12) -
module
_ exec (12) -
module
_ function (12) - name (12)
-
need
_ tar (12) -
need
_ tar _ bz2 (12) -
need
_ tar _ bz2= (12) -
need
_ tar _ gz (12) -
need
_ zip (12) - needed? (12)
- next (12)
-
ole
_ query _ interface (12) -
on
_ head (12) -
on
_ tail (12) -
original
_ name (24) - owned? (10)
- pack (21)
- parameters (7)
- parse (12)
- path (12)
- peek (12)
- peep (12)
- pop (24)
- post (12)
- pread (8)
-
prepend
_ features (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
primitive
_ convert (48) - priority (12)
- priority= (12)
- private (48)
-
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) - public (12)
-
public
_ method _ defined? (12) -
public
_ send (24) - raise (18)
- read (12)
-
read
_ body (24) - readbyte (24)
- readlines (12)
- receiver (18)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) - resume (12)
-
return
_ value (12) -
ruby2
_ keywords (12) - send (24)
-
set
_ backtrace (12) -
set
_ trace _ func (12) - shift (24)
- signal (12)
-
singleton
_ method _ removed (12) -
singleton
_ methods (12) -
sort
_ by (24) -
start
_ with? (18) - step (62)
- sub! (12)
- sum (12)
- synchronize (12)
- tag (11)
-
thread
_ variable _ set (12) -
to
_ a (12) -
to
_ ary (24) -
to
_ bn (12) -
to
_ enum (36) -
to
_ int (12) -
to
_ json (24) -
to
_ proc (12) -
to
_ regexp (12) -
to
_ s (66) -
to
_ str (12) - transfer (12)
- unpack (12)
- unshift (8)
- upto (12)
- value (11)
-
with
_ object (24) -
write
_ headers? (12) - yield (12)
検索結果
先頭5件
-
Encoding
:: InvalidByteSequenceError # error _ bytes -> String (27313.0) -
エラー発生時に捨てられたバイト列を返します。
...mlist[例][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 $!.reada......gain_bytes.dump #=> "\xFF"
end
//}
@see Encoding::InvalidByteSequenceError#readagain_bytes... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (24613.0) -
各属性に対しブロックを呼び出します。
... REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root....../a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}... -
Module
# prepend _ features(mod) -> self (24449.0) -
Module#prepend から呼び出されるメソッドで、 prepend の処理の実体です。このメソッド自体は mod で指定した モジュール/クラスの継承チェインの先頭に self を追加します。
...Module#prepend から呼び出されるメソッドで、
prepend の処理の実体です。このメソッド自体は mod で指定した
モジュール/クラスの継承チェインの先頭に self を追加します。
このメソッドを上書きすることで、prepend の処理を変......ram mod prepend を呼び出したモジュール
@return mod が返されます
//emlist[例][ruby]{
class Recorder
RECORDS = []
end
module X
def self.prepend_features(mod)
Recorder::RECORDS << mod
end
end
class A
prepend X
end
class B
include X
end
class C
prepend X
end
Recor......der::RECORDS # => [A, C]
//}
@see Module#prepend, Module#prepended... -
Thread
# thread _ variable _ set(key , value) (24319.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
... Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく
ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thread_variable_set(:cat, 'meow')
Thread.cur......rent.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (21625.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ption#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Dat......month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_ex......ception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
String
# append _ as _ bytes(*objects) -> self (21337.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...st[例][ruby]{
s = "あ".b # => "\xE3\x81\x82"
s.encoding # => #<Encoding:BINARY (ASCII-8BIT)>
s.append_as_bytes("い") # => "\xE3\x81\x82\xE3\x81\x84"
# s << "い" では連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) and UT......F-8 (Encoding::CompatibilityError)
//}
//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x61) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}
@see String#<<, String#concat... -
Rake
:: PackageTask # need _ tar _ bz2 -> bool (21313.0) -
この値が真である場合は bzip2 した tar ファイル (tar.bz2) を作成します。 デフォルトは偽です。
...ある場合は bzip2 した tar ファイル (tar.bz2) を作成します。
デフォルトは偽です。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'
Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.need_tar_bz2 # => false
end
//}... -
Rake
:: PackageTask # need _ tar _ bz2=(flag) (21313.0) -
bzip2 した tar ファイル (tar.bz2) を作成するかどうかを設定します。
...
bzip2 した tar ファイル (tar.bz2) を作成するかどうかを設定します。
@param flag 真または偽を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'
Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.nee......d_tar_bz2 # => false
package_task.need_tar_bz2 = true
package_task.need_tar_bz2 # => true
end
//}... -
Range
# end -> object (21310.0) -
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま せん。
...終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま
せん。
//emlist[例][ruby]{
(10..20).last # => 20
(10...20).last # => 20
//}
@see Range#begin... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (21307.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...