るりまサーチ

最速Rubyリファレンスマニュアル検索!
480件ヒット [1-100件を表示] (0.084秒)

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. csv values_at

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Enumerator::ArithmeticSequence#first -> Numeric | nil (21103.0)

等差数列の最初の要素、もしくは最初の n 要素を返します。

等差数列の最初の要素、もしくは最初の n 要素を返します。

@param n 取得する要素数。

Enumerator::ArithmeticSequence#first(n) -> [Numeric] (21103.0)

等差数列の最初の要素、もしくは最初の n 要素を返します。

等差数列の最初の要素、もしくは最初の n 要素を返します。

@param n 取得する要素数。

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

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

...個々の属性は REXML::Attribute オブジェクトで渡されます。

//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 (9207.0)

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

...Attributes#[]

//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("at...
...t") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

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

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

...o: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.att...
...ributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

絞り込み条件を変える

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

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

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

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

Thread::Backtrace::Location#path -> String (9107.0)

self が表すフレームのファイル名を返します。

...self が表すフレームのファイル名を返します。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}

@see Thread::Backtrace::Location#absolute_path...

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (6207.0)

name で指定される属性を返します。

...name で指定される属性を返します。

属性は REXML::Attribute オブジェクトの形で返します。

name は "foo:bar" のように prefix を指定することができます。

namespace で名前空間の URI を指定することで、その名前空間内で
name という...
...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.attribute("att") # => att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}...

Forwardable#delegate(hash) -> () (6113.0)

メソッドの委譲先を設定します。

...uire 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end

zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"...

Forwardable#instance_delegate(hash) -> () (6113.0)

メソッドの委譲先を設定します。

...uire 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end

zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"...

絞り込み条件を変える

<< 1 2 3 ... > >>