別のキーワード
ライブラリ
- ビルトイン (1938)
- csv (120)
- date (24)
- logger (12)
- openssl (36)
- pathname (12)
- rake (96)
-
rexml
/ document (492) -
rexml
/ streamlistener (12) -
rubygems
/ requirement (12) -
rubygems
/ version (12) - set (27)
- strscan (24)
クラス
- Array (233)
- BasicObject (60)
- CSV (72)
-
CSV
:: Row (36) -
CSV
:: Table (12) - Class (28)
- Complex (6)
- Date (24)
-
Encoding
:: Converter (24) -
Enumerator
:: Lazy (84) -
Enumerator
:: Yielder (12) - Exception (24)
-
File
:: Stat (12) - Float (48)
-
Gem
:: Requirement (12) -
Gem
:: Version (12) - Hash (149)
- Integer (84)
- Logger (12)
- Method (42)
- Module (168)
- Numeric (72)
- Object (132)
-
OpenSSL
:: BN (36) - Pathname (12)
- Proc (55)
-
REXML
:: Attributes (132) -
REXML
:: CData (24) -
REXML
:: Document (36) -
REXML
:: Element (168) -
REXML
:: Elements (108) -
REXML
:: Instruction (24) -
Rake
:: NameSpace (24) - Range (147)
- Rational (12)
-
RubyVM
:: InstructionSequence (82) - Set (36)
- String (148)
- StringScanner (24)
- Symbol (12)
- Thread (24)
-
Thread
:: Backtrace :: Location (12) - Time (12)
- TracePoint (7)
- UnboundMethod (12)
モジュール
- Comparable (24)
- Enumerable (204)
-
REXML
:: StreamListener (12) -
Rake
:: TaskManager (72)
キーワード
- ! (12)
- != (12)
- % (12)
- << (170)
- <= (58)
- <=> (186)
- == (12)
- === (24)
- [] (60)
- []= (12)
-
absolute
_ path (12) - add (24)
- add? (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
add
_ element (12) -
add
_ row (12) - ancestors (12)
- attribute (12)
-
backtrace
_ locations (36) -
base
_ label (24) - bind (12)
-
bit
_ length (12) - bsearch (48)
-
bsearch
_ index (20) - call (12)
-
chunk
_ while (12) -
class
_ variables (12) - cmp (12)
- concat (45)
-
const
_ source _ location (12) - content (12)
- convert (36)
- cover? (19)
-
define
_ task (12) - delete (24)
-
delete
_ all (24) -
delete
_ attribute (12) -
delete
_ if (24) - disasm (12)
- disassemble (12)
- div (12)
- divmod (24)
- downto (24)
-
drop
_ while (60) - each (24)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) - encoding (12)
- entitydecl (12)
-
enum
_ for (48) - filter (14)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ text (12) - include (12)
- include? (12)
- inherited (12)
- initialize (12)
-
insert
_ output (12) - inspect (12)
-
instance
_ eval (24) -
instance
_ methods (12) -
instance
_ of? (12) -
instruction
_ sequence (7) - intern (12)
-
is
_ a? (12) -
kind
_ of? (12) - label (12)
- lazy (12)
- length (12)
- lookup (12)
- max (130)
-
method
_ defined? (12) - methods (12)
- min (130)
- minmax (12)
- modulo (12)
- namespaces (12)
-
next
_ element (12) - pack (21)
- path (12)
- prefixes (12)
-
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) - puts (12)
- reject (24)
- reject! (24)
- remainder (12)
- replacement= (12)
- root (12)
-
root
_ node (12) - scrub (36)
- scrub! (36)
- select (24)
-
set
_ backtrace (12) - size (24)
-
slice
_ when (12) - sort (24)
- split (19)
-
stand
_ alone? (12) - subclasses (4)
-
super
_ method (11) - superclass (12)
-
synthesize
_ file _ task (12) -
take
_ while (72) - target (12)
- tasks (24)
- text (12)
-
to
_ a (24) -
to
_ ary (12) -
to
_ binary (10) -
to
_ csv (12) -
to
_ enum (48) -
to
_ h (19) -
to
_ s (36) -
undef
_ method (12) - unpack (12)
- value (12)
- version (12)
- xpath (12)
- yield (12)
検索結果
先頭5件
-
Module
# <(other) -> bool | nil (18243.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil
p Foo < Object.new # => in `<': compared with non class/mod... -
Hash
# <(other) -> bool (18225.0) -
self が other のサブセットである場合に真を返します。
...サブセットである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 < h2 # => true
h2 < h1 # => false
h1 < h1 # => false
//}
@see Hash#<=, Hash#>=, Hash#>... -
Comparable
# <(other) -> bool (18219.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
... <=> をもとにオブジェクト同士を比較します。
<=> が負の整数を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentError <......=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 < 1 # => false
1 < 2 # => true
//}... -
Integer
# <(other) -> bool (18219.0) -
比較演算子。数値として小さいか判定します。
...比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}... -
Float
# <(other) -> bool (18213.0) -
比較演算子。数値として小さいか判定します。
...数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 < 3.1415 # => true
3.14 <= 3.1415 # => true
//}... -
Date
# <<(n) -> Date (6315.0) -
self より n ヶ月前の日付オブジェクトを返します。 n は数値でなければなりません。
...ruby]{
require 'date'
Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
Date.new(2001,2,3) << -2 #=> #<Date: 2001-04-03 ...>
//}
対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。
//emlist[][ruby]{
require 'date'
Date.new(2001,3,28) <......< 1 #=> #<Date: 2001-02-28 ...>
Date.new(2001,3,31) << 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,3,31) << 2 #=> #<Date: 2001-01-31 .........>
Date.new(2001,3,31) << 1 << 1 #=> #<Date: 2001-01-28 ...>
Date.new(2001,3,31) << 1 << -1 #=> #<Date: 2001-03-28 ...>
//}
Date#prev_month も参照してください。
@param n 月数... -
Time
# <=>(other) -> -1 | 0 | 1 | nil (6290.0) -
self と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、 小さい場合は -1 を返します。比較できない場合は、nil を返します。
...場合は -1 を返します。比較できない場合は、nil を返します。
@param other 自身と比較したい時刻を Time オブジェクトで指定します。
//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00......p t <=> t2 # => -1
p t2 <=> t # => 1
//}
//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 0.1 # => 2000-01-01 00:00:00 +0900
p t.nsec # => 0
p t2.nsec # => 100000000
p t <=> t2 # => -1
p......t2 <=> t # => 1
p t <=> t # => 0
//}... -
String
# <=>(other) -> -1 | 0 | 1 | nil (6242.0) -
self と other を ASCII コード順で比較して、 self が大きい時には 1、等しい時には 0、小さい時には -1 を返します。 このメソッドは Comparable モジュールのメソッドを実装するために使われます。
...時には 0、小さい時には -1 を返します。
このメソッドは Comparable モジュールのメソッドを実装するために使われます。
other が文字列でない場合、
other.to_str と other.<=> が定義されていれば
0 - (other <=> self) の結果を返します......します。
@param other 文字列
@return 比較結果の整数か nil
//emlist[例][ruby]{
p "aaa" <=> "xxx" # => -1
p "aaa" <=> "aaa" # => 0
p "xxx" <=> "aaa" # => 1
p "string" <=> "stringAA" # => -1
p "string" <=> "string" # => 0
p "stringAA" <=> "string" # => 1
//}... -
Module
# <=>(other) -> Integer | nil (6237.0) -
self と other の継承関係を比較します。
...self と other の継承関係を比較します。
self と other を比較して、
self が other の子孫であるとき -1、
同一のクラス/モジュールのとき 0、
self が other の先祖であるとき 1
を返します。
継承関係にないクラス同士の比較では
n......のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=> Object.new # => nil
//}...