るりまサーチ

最速Rubyリファレンスマニュアル検索!
1338件ヒット [101-200件を表示] (0.151秒)
トップページ > クエリ:i[x] > クエリ:-[x] > クエリ:first[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 ... > >>

RubyVM::InstructionSequence#first_lineno -> Integer (15319.0)

self が表す命令シーケンスの 1 行目の行番号を返します。

...の 1 行目の行番号を返します。

例1:irb で実行した場合

RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1

例2:

# /tmp/method.rb
require "foo-library"
def foo
p :foo
end

RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2...

PrettyPrint#first? -> bool (12313.0)

このメソッドは obsolete です。

...です。

現在のグループで first? に対する最初の呼び出しかどうかを判定する
述語です。これはカンマで区切られた値を整形するのに有用です。

pp.group(1, '[', ']') {
xxx.each {|yyy|
unless pp.first?
pp.text ','
pp.bre...
...akable
end
... pretty printing yyy ...
}
}...

RubyVM::AbstractSyntaxTree::Node#first_column -> Integer (12313.0)

ソースコード中で、self を表すテキストが最初に現れる列番号を返します。

...ソースコード中で、self を表すテキストが最初に現れる列番号を返します。

列番号は0-originで、バイト単位で表されます。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_column # => 0
//}...

RubyVM::AbstractSyntaxTree::Node#first_lineno -> Integer (12313.0)

ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

...ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

行番号は1-originです。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//}...

Matrix#first_minor(row, column) -> Matrix (12301.0)

self から第 row 行と第 column 列を取り除いた行列を返します。

...self から第 row 行と第 column 列を取り除いた行列を返します。

@param row 行
@param column 列
@raise ArgumentError row, column が行列の行数/列数を越えている場合に発生します。...

絞り込み条件を変える

REXML::Node#find_first_recursive {|node| ... } -> REXML::Node | nil (12301.0)

self とその各 element node を引数とし、ブロックを呼び出し、 そのブロックの返り値が真であった最初の node を返します。

...self とその各 element node を引数とし、ブロックを呼び出し、
そのブロックの返り値が真であった最初の node を返します。

見付からなかった場合は nil を返します。...

REXML::Attributes#each_attribute {|attribute| ... } -> () (9306.0)

各属性に対しブロックを呼び出します。

...ribute オブジェクトで渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first...
...a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (9306.0)

name という名前の属性を取得します。

...得します。

name という名前を持つ属性がない場合は nil を返します。

@param name 属性名(文字列)
@see REXML::Attributes#[]

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://e...
...xample.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (9306.0)

namespace と name で特定される属性を返します。

...る属性を返します。

namespace で名前空間を、 name で prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使...
...I, 文字列)
@param name 属性名(文字列)

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first...
...a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

IO.binwrite(path, string, offset=nil) -> Integer (6412.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...path で指定されるファイルを開き、string を書き込み、
閉じます。

ファイルを開くときの mode が "rb:ASCII-8BIT" で、バイナリモードが有効
である点以外は IO.write と同じです。

Kernel.#open と同様 path の先頭が "|" ならば、"|" に...
...名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置

//emlist[例][ruby]{
# 8x8の真っ白なPNG画像データ。
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjP
QBoAAAAASUVORK5CYII='.unpack('m').first

# 期待する先頭16...
...{|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52

# binwriteを使用した場合: どの環境でも正しく保存できる。
I
O.binwrite('white.binmode.png', png)
puts IO.binread('white.binmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e...

絞り込み条件を変える

Enumerable#inject(init = self.first) {|result, item| ... } -> object (6402.0)

リストのたたみこみ演算を行います。

...リストのたたみこみ演算を行います。

最初に初期値 init と self の最初の要素を引数にブロックを実行します。
2 回目以降のループでは、前のブロックの実行結果と
self の次の要素を引数に順次ブロックを実行します。
...
...して最後の要素まで繰り返し、最後のブロックの実行結果を返します。

要素が存在しない場合は init を返します。

初期値 init を省略した場合は、
最初に先頭の要素と 2 番目の要素をブロックに渡します。
また要素が 1 つ...
...かなければブロックを実行せずに最初の要素を返します。
要素がなければブロックを実行せずに nil を返します。

@param init 最初の result の値です。任意のオブジェクトが渡せます。
@param sym ブロックの代わりに使われる...
<< < 1 2 3 4 ... > >>