396件ヒット
[1-100件を表示]
(0.216秒)
ライブラリ
- ビルトイン (260)
- date (22)
- ipaddr (11)
-
irb
/ cmd / help (11) -
net
/ imap (11) -
rexml
/ document (22) -
rexml
/ streamlistener (11) - shell (12)
-
shell
/ command-processor (24) -
shell
/ filter (12)
クラス
- Date (22)
-
Enumerator
:: Lazy (85) - IPAddr (11)
-
IRB
:: ExtendCommand :: Help (11) - Integer (21)
- Module (11)
-
Net
:: IMAP :: FetchData (11) - Object (11)
-
Process
:: Status (11) -
REXML
:: Element (22) -
RubyVM
:: InstructionSequence (44) - Shell (12)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (12) - String (77)
モジュール
キーワード
- [] (21)
-
absolute
_ path (11) - attr (11)
-
base
_ label (11) - cat (6)
- chunk (22)
-
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) - echo (18)
- entitydecl (11)
- execute (11)
- glob (18)
- gsub (44)
- label (11)
-
next
_ year (11) - path (11)
- prepend (11)
-
singleton
_ class (11) -
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - sub (33)
- tee (6)
検索結果
先頭5件
-
Date
# >>(n) -> Date (21395.0) -
self から n ヶ月後の日付オブジェクトを返します。 n は数値でなければなりません。
...self から n ヶ月後の日付オブジェクトを返します。
n は数値でなければなりません。
//emlist[][ruby]{
require 'date'
Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
//}
対応する月に同じ日が存......re 'date'
Date.new(2001,1,28) >> 1 #=> #<Date: 2001-02-28 ...>
Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2......#=> #<Date: 2001-03-31 ...>
Date.new(2001,1,31) >> 1 >> 1 #=> #<Date: 2001-03-28 ...>
Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
//}
Date#next_month も参照してください。
@param n 月数... -
IPAddr
# >>(num) -> IPAddr (21301.0) -
ビットごとの右シフト演算により、新しい IPAddr オブジェクトを生成します。
...ビットごとの右シフト演算により、新しい IPAddr オブジェクトを生成します。
@param num 右シフトする桁数。... -
Process
:: Status # >>(num) -> Integer (21223.0) -
self.to_i >> num と同じです。
...self.to_i >> num と同じです。
@param num 整数を指定します。
fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (15355.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と......象となります。
max に 0 を指定すると、max の指定は無視されます(0個ではありません)。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][rub......ument'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_w... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (15355.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無......@param text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <......b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
Object
# singleton _ class -> Class (12307.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...バが nil か true か false なら、それぞれ NilClass, TrueClass,
FalseClass を返します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class......#=> #<Class:String>
nil.singleton_class #=> NilClass
//}
@see Object#class... -
Date
# next _ year(n = 1) -> Date (12236.0) -
n 年後を返します。
...n 年後を返します。
self >> (n * 12) に相当します。
//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}
Date#......>> も参照してください。
@param n 年数... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (12207.0) -
self が表す命令シーケンスの絶対パスを返します。
...ら作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.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::InstructionSequence#path... -
RubyVM
:: InstructionSequence # base _ label -> String (12207.0) -
self が表す命令シーケンスの基本ラベルを返します。
...iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/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 # label -> String (12207.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...ベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<co......M::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
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...