別のキーワード
クラス
- Exception (24)
- Method (12)
- Module (12)
-
RubyVM
:: InstructionSequence (24) -
Thread
:: Queue (30) -
Thread
:: SizedQueue (30) - UnboundMethod (12)
モジュール
- Enumerable (64)
キーワード
- == (12)
- autoload (12)
-
backtrace
_ locations (12) - deq (20)
-
first
_ lineno (12) - none? (32)
- one? (32)
- pop (20)
- shift (20)
-
source
_ location (24) -
to
_ a (12)
検索結果
先頭5件
-
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9209.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return......if Date.new(2000, 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>'", "t......est.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Enumerable
# none? -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。
...ます。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set[].none? # => true
Set[nil].none?......# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}......します。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none?......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}
@see Array#none?... -
Enumerable
# none? {|obj| . . . } -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。
...ます。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set[].none? # => true
Set[nil].none?......# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}......します。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none?......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}
@see Array#none?... -
Enumerable
# none?(pattern) -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。
...します。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none?......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}......# => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}
@see Array#none?... -
Enumerable
# one? -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。
...]{
require 'set'
Set['ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one? # => true
Set[].one......す。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one?......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}
@see Array#one?... -
Enumerable
# one? {|obj| . . . } -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。
...]{
require 'set'
Set['ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one? # => true
Set[].one......す。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one?......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}
@see Array#one?... -
Enumerable
# one?(pattern) -> bool (6109.0) -
ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。
...す。
//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one?......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}......# => false
Set[nil, true, false].one? # => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}
@see Array#one?... -
Method
# source _ location -> [String , Integer] | nil (6109.0) -
ソースコードのファイル名と行番号を配列で返します。
...@see Proc#source_location
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----
require '/tmp/foo'
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]
method(:puts).source_location # => nil
//}... -
UnboundMethod
# source _ location -> [String , Integer] | nil (6109.0) -
ソースコードのファイル名と行番号を配列で返します。
...nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}
@see Proc#source_location, Method#source_location...