別のキーワード
ライブラリ
- ビルトイン (499)
- csv (120)
- date (24)
- logger (12)
- openssl (24)
- pathname (12)
-
rake
/ loaders / makefile (12) -
rexml
/ document (516) -
rexml
/ streamlistener (12) -
rubygems
/ requirement (12) -
rubygems
/ version (12) - strscan (24)
クラス
- Array (18)
- BasicObject (60)
- CSV (72)
-
CSV
:: Row (36) -
CSV
:: Table (12) - Date (24)
-
Encoding
:: Converter (24) -
Enumerator
:: Yielder (12) - Exception (12)
-
File
:: Stat (12) -
Gem
:: Requirement (12) -
Gem
:: Version (12) - Hash (19)
- Logger (12)
- Method (35)
- Module (36)
- Object (120)
-
OpenSSL
:: BN (24) - Pathname (12)
-
REXML
:: Attributes (144) -
REXML
:: CData (24) -
REXML
:: Document (36) -
REXML
:: Element (180) -
REXML
:: Elements (108) -
REXML
:: Instruction (24) -
Rake
:: MakefileLoader (12) - StringScanner (24)
- Thread (24)
-
Thread
:: Backtrace :: Location (12) - TracePoint (7)
- UnboundMethod (12)
モジュール
- Enumerable (96)
-
REXML
:: StreamListener (12)
キーワード
- ! (12)
- != (12)
- << (96)
- <=> (84)
- == (12)
- [] (24)
- []= (24)
- add (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
add
_ element (12) -
add
_ row (12) - attribute (12)
-
backtrace
_ locations (36) -
base
_ label (12) - bind (12)
- cmp (12)
- concat (24)
- content (12)
- convert (36)
- delete (24)
-
delete
_ all (24) -
delete
_ attribute (12) - each (24)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) - encoding (12)
- entitydecl (12)
-
enum
_ for (24) -
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ text (12) - initialize (12)
-
insert
_ output (12) - inspect (12)
-
instance
_ eval (24) -
instance
_ of? (12) -
instruction
_ sequence (7) -
is
_ a? (12) -
kind
_ of? (12) - length (12)
- load (12)
- max (48)
- methods (12)
- min (48)
- namespaces (12)
-
next
_ element (12) - pack (18)
- prefixes (12)
- puts (12)
- replacement= (12)
- root (12)
-
root
_ node (12) - size (24)
-
stand
_ alone? (12) -
super
_ method (11) - target (12)
- text (12)
- text= (12)
-
to
_ a (12) -
to
_ csv (12) -
to
_ enum (24) -
to
_ h (19) -
to
_ s (36) -
undef
_ method (12) - value (12)
- version (12)
- xpath (12)
検索結果
先頭5件
-
Module
# <(other) -> bool | nil (18149.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... -
Date
# <<(n) -> Date (6161.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 月数... -
Date
# <=>(other) -> -1 | 0 | 1 | nil (6161.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...//emlist[][ruby]{
require "date"
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 4) # => -1
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 3) # => 0
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 2) # => 1
p Date.new(2001, 2, 3) <=> Object.new # => nil
p Date.new(2001, 2, 3) <=> Rational(49038... -
Gem
:: Version # <=>(other) -> -1 | 0 | 1 | nil (6149.0) -
self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が Gem::Version ではなく比較できないとき、 nil を返します。
...返します。
//emlist[][ruby]{
p Gem::Version.new("3.9.0") <=> Gem::Version.new("3.10.0") # => -1
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0.0") # => 0
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0") # => 0
p Gem::Version.new("3.9.0") <=> "3.9.0" # => nil
//}
@param... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (6149.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...いときには 1 を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}
@param other 比較する整数... -
Pathname
# <=>(other) -> -1 | 0 | 1 | nil (6143.0) -
パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") <=> Pathname.new("foo/bar")
p Pathname.new("foo/bar") <=> Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") <=> Pathname.new("foo/bar")
# => 0
# 1
# -1
//}... -
File
:: Stat # <=>(o) -> Integer | nil (6137.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...//emlist[][ruby]{
require 'tempfile' # for Tempfile
fp1 = Tempfile.open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::Stat.new(fp2.path) #=> -1
p File::Stat.new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1......p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
REXML
:: Elements # <<(element = nil) -> REXML :: Element (6137.0) -
要素 element を追加します。
...ML::Element.new(element)
で生成される要素を追加します。
element を省略した場合は、空の要素が追加されます。
追加された要素が返されます。
@param element 追加する要素
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new('a')
a.ele......ments.add(REXML::Element.new('b')) # => <b/>
a.to_s # => "<a><b/></a>"
a.elements.add('c') # => <c/>
a.to_s # => "<a><b/><c/></a>"
//}... -
StringScanner
# <<(str) -> self (6131.0) -
操作対象の文字列に対し str を破壊的に連結します。 マッチ記録は変更されません。
...す。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test') # => #<StringScanner 0/4 @ "test">
s.scan(/\w(\w*)/) # => "test"
s[0] # => "test"
s[1] # => "est"
s << ' string' # => #<StringScanner 4/11 "test"......ring"
//}
この操作は StringScanner.new に渡した文字列にも影響することがあります。
//emlist[例][ruby]{
require 'strscan'
str = 'test'
s = StringScanner.new(str) # => #<StringScanner 0/4 @ "test">
s << ' string' # => #<StringScanner 0/11 @ "test ...">
str...