6836件ヒット
[1-100件を表示]
(0.124秒)
別のキーワード
ライブラリ
クラス
-
ARGF
. class (60) - Array (655)
- BasicObject (84)
- BigDecimal (132)
- Binding (12)
-
CSV
:: Row (24) -
CSV
:: Table (24) - Class (12)
- Complex (66)
- Data (6)
- Date (12)
- Dir (92)
- Enumerator (24)
- Exception (24)
- Fiber (30)
- File (16)
-
File
:: Stat (12) - Float (32)
- FrozenError (6)
-
Gem
:: Version (36) - Hash (263)
- IO (312)
- Integer (471)
-
JSON
:: State (24) - MatchData (24)
- Matrix (239)
-
Matrix
:: LUPDecomposition (12) - Method (46)
- Module (308)
- Mutex (2)
- Numeric (311)
- Object (190)
-
OpenSSL
:: BN (72) - OptionParser (240)
- Pathname (228)
-
Prime
:: PseudoPrimeGenerator (48) -
Psych
:: Stream (24) -
REXML
:: Attributes (12) -
REXML
:: Child (24) -
REXML
:: Element (24) -
Rake
:: FileList (12) - Random (24)
- Range (77)
- Rational (87)
-
RubyVM
:: AbstractSyntaxTree :: Node (14) -
RubyVM
:: InstructionSequence (84) - Set (72)
- String (1357)
- StringIO (100)
- StringScanner (72)
- Struct (10)
- Symbol (36)
- Thread (34)
-
Thread
:: Backtrace :: Location (60) -
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (10) -
Thread
:: SizedQueue (10) - Time (48)
- TracePoint (72)
- UnboundMethod (48)
- Vector (24)
-
WIN32OLE
_ TYPE (12)
モジュール
- Comparable (21)
- Enumerable (295)
キーワード
- ! (12)
- != (12)
- % (43)
- * (24)
- ** (12)
- + (24)
- +@ (22)
- -@ (31)
- < (24)
- << (24)
- <= (24)
- <=> (138)
- == (48)
- === (24)
- =~ (12)
- > (24)
- >= (24)
- [] (96)
- []= (91)
-
_ dump (12) - abbrev (12)
- abs (12)
- abs2 (12)
-
absolute
_ path (24) - add? (12)
-
add
_ namespace (24) -
alias
_ method (8) - allbits? (8)
-
angle
_ with (12) - anybits? (8)
-
append
_ as _ bytes (1) - atime (12)
- autoload (12)
-
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) - byterindex (3)
- bytes (38)
- capitalize! (12)
- casecmp (12)
- casecmp? (9)
- ceil (36)
- ceildiv (3)
- center (12)
- chars (24)
- children (26)
- chomp (12)
- chomp! (12)
- chop! (12)
- chown (12)
- chr (36)
-
chunk
_ while (12) - clamp (9)
-
class
_ eval (12) - clear (12)
-
clear
_ bit! (12) - clone (12)
- close (22)
- closed? (12)
- codepoints (24)
- coerce (60)
- collect! (38)
- column (24)
- combination (24)
- compact! (9)
-
compare
_ by _ identity (12) - concat (33)
- configure (12)
- conj (12)
- conjugate (12)
- count (12)
- crypt (12)
- ctime (12)
- curry (11)
-
deconstruct
_ keys (3) - dedup (3)
- default (24)
-
default
_ event _ sources (12) -
define
_ singleton _ method (24) -
defined
_ class (12) - delete (24)
- delete! (12)
- delete? (12)
-
delete
_ if (96) -
delete
_ prefix! (8) -
delete
_ suffix! (8) - difference (7)
- dig (30)
- digits (24)
- dirname (12)
- disable (24)
- disasm (12)
- disassemble (12)
- disjoint? (12)
- display (12)
- div (12)
- divmod (36)
- downcase! (12)
- downto (24)
- dup (12)
- each (192)
-
each
_ byte (72) -
each
_ char (48) -
each
_ child (38) -
each
_ codepoint (24) -
each
_ cons (4) -
each
_ entry (12) -
each
_ grapheme _ cluster (16) -
each
_ index (24) -
each
_ line (144) -
each
_ pair (24) -
each
_ slice (8) -
each
_ with _ index (72) - eigen (12)
- eigensystem (12)
- enable (24)
- encode (36)
- encode! (24)
-
end
_ with? (18) - entries (19)
-
enum
_ for (24) - equal? (12)
- eval (12)
- exception (24)
- fdiv (36)
-
fetch
_ values (2) - fileno (11)
- fill (72)
- filter! (28)
- finite? (9)
- flatten (12)
- flatten! (24)
- floor (36)
- flush (12)
-
force
_ encoding (12) - gcd (12)
- gcdlcm (12)
- getbyte (12)
- getc (12)
-
grapheme
_ clusters (16) - gsub! (48)
- hash (24)
- hex (12)
- hstack (12)
- import (12)
- include (12)
- include? (12)
- included (12)
-
included
_ modules (12) - infinite? (9)
- inherited (12)
-
initialize
_ copy (12) - inject (36)
- insert (24)
- inspect (55)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
keep
_ if (48) - label (24)
- lcm (12)
- lines (38)
- ljust (12)
- localtime (24)
- lshift! (12)
- lup (12)
-
lup
_ decomposition (12) - magnitude (12)
- map! (38)
-
mask
_ bits! (12) - match (24)
- match? (9)
-
max
_ by (48) - merge (12)
- minor (24)
-
mod
_ inverse (12) -
module
_ eval (12) - modulo (24)
- name= (10)
- negative? (29)
- next (12)
- next! (12)
-
next
_ sibling= (12) - nobits? (8)
- nonzero? (12)
- offset (24)
- on (144)
-
on
_ head (12) -
on
_ tail (12) - ord (12)
- order! (24)
- parse! (12)
-
parse
_ csv (12) - partition (12)
- path (32)
- permutation (24)
- permute! (12)
- polar (12)
- pos= (12)
- positive? (29)
- pow (24)
- pred (12)
- prerelease? (12)
-
pretty
_ print (12) -
previous
_ sibling= (12) -
prime
_ division (12) -
private
_ class _ method (24) -
private
_ constant (12) - product (24)
- public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) - putc (12)
- quo (12)
- raise (18)
- rand (24)
- rationalize (12)
- realpath (24)
- receiver (6)
- rect (12)
- rectangular (12)
- reduce (36)
- reject (24)
- reject! (60)
-
relative
_ path _ from (12) - release (12)
- remainder (36)
- reopen (36)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - reset (12)
- resume (12)
-
reverse
_ each (12) - rewind (24)
- rindex (12)
- rjust (12)
- round (12)
- row (24)
- rpartition (12)
- rshift! (12)
- rstrip! (12)
- sample (24)
- scan (24)
- scrub (36)
- scrub! (36)
- seek (12)
- select! (43)
-
set
_ bit! (12) - shift (12)
- signal (12)
-
singleton
_ methods (12) - size (13)
- slice (72)
-
slice
_ when (12) - solve (12)
- sort (24)
- sort! (24)
-
sort
_ by (24) -
sort
_ by! (12) - split (26)
- squeeze! (12)
- start (24)
-
start
_ with? (18) - step (112)
- strip! (12)
- sub! (36)
- succ (12)
- succ! (12)
- sum (24)
- summarize (24)
-
super
_ method (11) - swapcase! (12)
- synchronize (12)
- taint (9)
- terminate (12)
- times (24)
-
to
_ a (7) -
to
_ bn (12) -
to
_ csv (12) -
to
_ enum (24) -
to
_ h (19) -
to
_ path (8) -
to
_ proc (12) -
to
_ s (72) -
tr
_ s! (12) -
transform
_ keys! (20) -
transform
_ values! (18) - truncate (12)
- undump (8)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - union (7)
- uniq (24)
- unscan (12)
- unshift (12)
- untaint (9)
- upcase! (12)
- upto (36)
- using (12)
- vstack (12)
- wait (12)
-
wait
_ readable (12) - with (3)
-
with
_ index (24) -
yield
_ self (16) - zip (48)
検索結果
先頭5件
-
TracePoint
# self -> object (21132.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... -
RubyVM
:: InstructionSequence # inspect -> String (15235.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#labe......l,
RubyVM::InstructionSequence#path... -
Object
# yield _ self -> Enumerator (12297.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
# yield _ self {|x| . . . } -> object (12297.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
# define _ singleton _ method(symbol) { . . . } -> Symbol (12283.0) -
self に特異メソッド name を定義します。
...
self に特異メソッド name を定義します。
@param symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Sy......mbol を返します。
//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (12283.0) -
self に特異メソッド name を定義します。
...
self に特異メソッド name を定義します。
@param symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Sy......mbol を返します。
//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello... -
RubyVM
:: AbstractSyntaxTree :: Node # inspect -> String (12235.0) -
self のデバッグ用の情報を含んだ文字列を返します。
...
self のデバッグ用の情報を含んだ文字列を返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (12135.0) -
self の子ノードを配列で返します。
...
self の子ノードを配列で返します。
どのような子ノードが返ってくるかは、そのノードの type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::......AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//}... -
RubyVM
:: InstructionSequence # disasm -> String (12123.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... -
RubyVM
:: InstructionSequence # disassemble -> String (12123.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... -
String
# lines(rs = $ / , chomp: false) {|line| . . . } -> self (9384.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...す。(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指......rs を取り除きます。
//emlist[][ruby]{
"hello\nworld\n".lines # => ["hello\n", "world\n"]
"hello\nworld\n".lines(chomp: true) # => ["hello", "world"]
//}
@param rs 行末を示す文字列
@param chomp 分割した各行に対して String#chomp と同等の結果を得......省略した場合は false を指定したとみなされます。
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line... -
String
# lines(rs = $ / ) {|line| . . . } -> self (9366.0) -
文字列中の各行を文字列の配列で返します。(self.each_line.to_a と同じです)
...す。(self.each_line.to_a と同じです)
//emlist[][ruby]{
"aa\nbb\ncc\n".lines # => ["aa\n", "bb\n", "cc\n"]
//}
行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指......(つまり空行で分割します)。
@param rs 行末を示す文字列
ブロックが指定された場合は String#each_line と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_line...