5434件ヒット
[1-100件を表示]
(0.091秒)
別のキーワード
ライブラリ
クラス
-
ARGF
. class (36) - Array (442)
- BasicObject (84)
- BigDecimal (204)
- Binding (30)
- CSV (24)
-
CSV
:: Table (108) - Class (12)
- Complex (36)
- Data (12)
- Dir (36)
- Enumerator (48)
- Fiber (30)
- Float (80)
- FrozenError (6)
-
Gem
:: Version (24) - Hash (454)
- IO (84)
- Integer (213)
- MatchData (24)
-
Matrix
:: LUPDecomposition (12) - Method (104)
- Module (324)
- Mutex (4)
- Numeric (103)
- Object (318)
-
OpenSSL
:: BN (132) - OpenStruct (19)
- OptionParser (204)
- Pathname (141)
- Proc (14)
-
REXML
:: Attributes (36) -
REXML
:: Child (24) -
REXML
:: Element (48) -
Rake
:: FileList (24) - Range (30)
- Rational (30)
-
Resolv
:: DNS :: Name (12) -
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (120) - Set (84)
- String (699)
- StringIO (38)
- Struct (53)
- Symbol (45)
- Thread (24)
-
Thread
:: Backtrace :: Location (72) -
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (20) - Time (108)
- TracePoint (60)
- UnboundMethod (48)
-
WIN32OLE
_ TYPE (12)
モジュール
- Comparable (27)
- Enumerable (361)
-
OptionParser
:: Arguable (24)
キーワード
- ! (12)
- != (12)
- !~ (12)
- % (24)
- ** (11)
- + (12)
- < (46)
- << (38)
- <= (46)
- <=> (24)
- == (111)
- === (56)
- > (46)
- >= (46)
- >> (14)
- [] (108)
- []= (12)
-
_ dump (12) - abbrev (12)
- abs (36)
- abs2 (12)
- absolute? (12)
-
absolute
_ path (24) - allbits? (8)
- anybits? (8)
- append (8)
-
append
_ as _ bytes (1) -
backtrace
_ locations (24) -
base
_ label (24) - basename (12)
- between? (12)
- bind (12)
-
bind
_ call (12) - binmode (24)
- binread (12)
-
bit
_ length (12) - broadcast (12)
- bsearch (24)
-
bsearch
_ index (20) -
by
_ col! (12) -
by
_ col _ or _ row! (12) -
by
_ row! (12) - byterindex (3)
- bytes (38)
- call (24)
- casecmp? (9)
- ceil (24)
- chars (12)
- children (7)
-
chunk
_ while (12) - clamp (15)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
clear
_ bit! (12) - closed? (12)
- codepoints (12)
- coerce (24)
- combination (24)
- compact (13)
- compact! (9)
-
compare
_ by _ identity (12) - concat (18)
- cover? (14)
- curry (22)
- deconstruct (3)
- default (24)
-
default
_ event _ sources (12) -
define
_ singleton _ method (24) - delete (12)
-
delete
_ if (24) - dig (30)
- digits (12)
- disable (24)
- disasm (12)
- disassemble (12)
- disjoint? (12)
- display (12)
- divmod (12)
- each (96)
-
each
_ byte (72) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ cons (8) -
each
_ entry (24) -
each
_ grapheme _ cluster (8) -
each
_ key (24) -
each
_ pair (36) -
each
_ slice (8) -
each
_ value (24) -
each
_ with _ index (24) - empty? (9)
- enable (24)
- encode (36)
-
end
_ with? (18) - entries (7)
-
enum
_ for (24) - eql? (51)
- equal? (36)
- eval (24)
- extend (12)
-
extend
_ object (12) - extended (12)
-
fetch
_ values (22) - filter! (28)
- finite? (9)
-
first
_ column (7) -
first
_ lineno (19) - floor (24)
- fnmatch (12)
- freeze (12)
- friday? (12)
- getbyte (12)
- getc (12)
- gmt? (12)
-
grapheme
_ clusters (8) - gsub! (60)
-
has
_ elements? (12) - hash (12)
- include? (12)
- inherited (12)
-
initialize
_ copy (12) - inject (36)
- insert (12)
- inspect (37)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) - iseuc (12)
- itself (12)
-
keep
_ if (48) - label (24)
-
last
_ column (7) -
last
_ lineno (7) - lineno (12)
- lshift! (12)
- magnitude (24)
-
marshal
_ load (12) -
mask
_ bits! (12) - match (12)
- match? (18)
-
max
_ by (48) - merge (24)
- merge! (24)
-
mod
_ add (12) -
mod
_ exp (12) -
mod
_ inverse (12) -
mod
_ mul (12) -
mod
_ sub (12) -
module
_ eval (24) -
module
_ exec (12) - modulo (12)
- monday? (12)
- mountpoint? (12)
- namespace (12)
- namespaces (24)
- negative? (29)
- next (12)
- next! (12)
-
next
_ sibling= (12) - nobits? (8)
- nonzero? (24)
- on (144)
-
on
_ head (12) -
on
_ tail (12) - order! (24)
- overlap? (2)
- owned? (12)
- path (24)
- permutation (12)
- permute! (12)
- pos= (12)
- positive? (29)
- pow (22)
- prefixes (24)
- prepend (20)
-
prepend
_ features (12) - prerelease? (12)
-
pretty
_ print (12) -
previous
_ sibling= (12) -
proper
_ subset? (12) -
proper
_ superset? (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) - push (24)
- putc (12)
- raise (18)
- read (12)
- readlines (12)
- realpath (12)
- receiver (17)
- reduce (36)
- rehash (12)
- relative? (12)
-
relative
_ path _ from (12) - remainder (12)
-
repeated
_ combination (24) - replace (12)
- resume (12)
-
reverse
_ each (48) - rewind (12)
- root? (12)
- rotate! (12)
- rshift! (12)
- sample (24)
- saturday? (12)
- scan (24)
- scrub (36)
- scrub! (36)
- seek (12)
- select! (48)
-
set
_ bit! (12) - shift (12)
- signal (12)
-
singleton
_ class? (12) -
singleton
_ methods (12) - slice (72)
-
slice
_ when (12) - solve (12)
- sort (24)
- sort! (24)
-
sort
_ by (24) -
sort
_ by! (24) -
source
_ location (7) - split (14)
-
start
_ with? (18) - step (62)
- sub (24)
- sub! (48)
-
subdomain
_ of? (12) - subset? (12)
- subtract (12)
- succ (12)
- succ! (12)
- sum (24)
- sunday? (12)
- superset? (12)
- synchronize (12)
- taint (9)
- tally (10)
- tap (12)
- then (14)
- thursday? (12)
-
to
_ a (19) -
to
_ bn (12) -
to
_ enum (24) -
to
_ h (69) -
to
_ proc (12) -
to
_ s (54) -
transform
_ keys! (20) -
transform
_ values! (18) - trust (9)
- tuesday? (12)
- type (7)
- unbind (12)
-
undef
_ method (12) -
unicode
_ normalized? (11) - union (7)
- uniq (24)
- unshift (12)
- untaint (9)
- untrust (9)
- update (24)
- upto (12)
- utc? (12)
- wait (12)
-
wait
_ readable (12) - wednesday? (12)
-
yield
_ self (16) - zero? (12)
- zip (48)
検索結果
先頭5件
-
TracePoint
# self -> object (18220.0) -
イベントを発生させたオブジェクトを返します。
...イベントを発生させたオブジェクトを返します。
以下のようにする事で同じ値を取得できます。
//emlist[例][ruby]{
trace.binding.eval('self')
//}
@see TracePoint#binding......返します。
以下のようにする事で同じ値を取得できます。
なお、self メソッドは binding が nil になる :c_call および :c_return イベントに対しても正しく動作します。
//emlist[例][ruby]{
trace.binding.eval('self')
//}
@see TracePoint#binding... -
String
# b -> String (18130.0) -
self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。
...
self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。
//emlist[例][ruby]{
'abc123'.encoding # => #<Encoding:UTF-8>
'abc123'.b.encoding # => #<Encoding:ASCII-8BIT>
//}... -
Object
# yield _ self {|x| . . . } -> object (9273.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}
値をメソッドチェインのパイプラインに次々と渡すの......は良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerat......返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}
@see Object#tap... -
Object
# itself -> object (9223.0) -
self を返します。
...
self を返します。
//emlist[][ruby]{
string = 'my string' # => "my string"
string.itself.object_id == string.object_id # => true
//}... -
Object
# yield _ self -> Enumerator (9173.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}
値をメソッドチェインのパイプラインに次々と渡すの......は良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerat......返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}
@see Object#tap... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (9123.0) -
self が表す命令シーケンスの絶対パスを返します。
...
self が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i......seq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::I... -
RubyVM
:: InstructionSequence # label -> String (9123.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1......:irb で実行した場合
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, w......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_label... -
Thread
:: Backtrace :: Location # base _ label -> String (9123.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...
self が表すフレームの基本ラベルを返します。通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)......end
end
Foo.new(0..2).locations.map do |call|
puts call.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
RubyVM
:: InstructionSequence # base _ label -> String (9117.0) -
self が表す命令シーケンスの基本ラベルを返します。
...
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.co......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 # disassemble -> String (9117.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1......( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
Module
# extend _ object(obj) -> object (6343.0) -
Object#extend の実体です。オブジェクトにモジュールの機能を追加します。
...Object#extend の実体です。オブジェクトにモジュールの機能を追加します。
Object#extend は、Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def extend(*modules)
modules.reverse_each do |mod|
# extend_object や extended はプライ......で
# 直接 mod.extend_object(self) などとは書けない
mod.__send__(:extend_object, self)
mod.__send__(:extended, self)
end
end
//}
extend_object のデフォルトの実装では、self に定義されて
いるインスタンスメソッドを obj の特異メソッドとし......て追加します。
@param obj self の機能を追加するオブジェクトを指定します。
@return obj で指定されたオブジェクトを返します。
@see Module#extended...