1591件ヒット
[101-200件を表示]
(0.121秒)
ライブラリ
- ビルトイン (745)
-
cgi
/ core (24) - csv (300)
- date (4)
- forwardable (12)
- matrix (12)
- open3 (48)
- prettyprint (1)
- psych (20)
- resolv (12)
-
rexml
/ document (216) -
rubygems
/ commands / which _ command (12) - socket (24)
クラス
- Array (36)
- CSV (252)
-
CSV
:: FieldInfo (24) -
CSV
:: Row (24) - Date (2)
- DateTime (2)
- Enumerator (6)
-
Enumerator
:: ArithmeticSequence (14) -
Enumerator
:: Lazy (36) -
File
:: Stat (12) - IO (12)
- Matrix (12)
- Object (48)
- PrettyPrint (1)
-
Psych
:: Handler (12) -
REXML
:: Attributes (144) -
REXML
:: Element (12) -
REXML
:: Parent (24) -
REXML
:: XPath (12) - Range (94)
-
Resolv
:: DNS :: Resource :: TXT (12) -
RubyVM
:: AbstractSyntaxTree :: Node (14) -
RubyVM
:: InstructionSequence (24) - Socket (12)
- String (216)
-
Thread
:: Backtrace :: Location (36) - Time (2)
モジュール
-
CGI
:: QueryExtension :: Value (24) - Enumerable (144)
- Forwardable (12)
- Kernel (36)
- Open3 (48)
- Psych (8)
-
REXML
:: Node (12) -
RubyVM
:: AbstractSyntaxTree (3) -
Socket
:: Constants (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - <=> (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 3
. 0 . 0 (5) - Range (12)
- Ruby用語集 (12)
-
SO
_ NREAD (24) - Transitive (12)
- WhichCommand (12)
- [] (84)
- []= (12)
- alias (12)
- attribute (12)
- begin (12)
- binwrite (12)
- caller (36)
-
cgi
/ session (12) -
chunk
_ while (12) -
col
_ sep (12) - convert (24)
-
deconstruct
_ keys (6) - delete (12)
-
delete
_ all (12) - each (24)
-
each
_ attribute (12) -
enum
_ for (24) -
fiddle
/ import (12) - fields (12)
- filter (36)
-
find
_ first _ recursive (12) - first? (1)
-
first
_ column (7) -
first
_ lineno (19) -
first
_ minor (12) - generate (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) - header (12)
-
header
_ convert (24) - index (12)
- inject (36)
-
insert
_ after (12) -
insert
_ before (12) - instance (24)
-
instance
_ delegate (12) - label (12)
- last (24)
- length (12)
- lineno (12)
- min (46)
- namespaces (12)
- new (48)
- of (3)
- open (48)
- parse (24)
- path (12)
-
pipeline
_ rw (24) -
pipeline
_ w (24) - prefixes (12)
- produce (6)
- rdoc (12)
- read (12)
- readlines (12)
- reduce (36)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 9 feature (12) -
safe
_ load (8) - size (12)
- slice (72)
- slice! (72)
-
slice
_ before (24) -
slice
_ when (12) -
take
_ while (24) -
to
_ a (12) -
to
_ enum (24) - tsort (12)
-
values
_ at (12) - パターンマッチ (12)
- リテラル (12)
- 演算子式 (12)
検索結果
先頭5件
-
Range
# first(n) -> [object] (21212.0) -
最初の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。
...を指定
した場合は to_int メソッドによる暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError n に負の数を指......定した場合に発生します。
//emlist[例][ruby]{
(10..20).first(3) # => [10, 11, 12]
//}
@see Range#last, 12697... -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (15213.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 (12213.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 (12207.0) -
ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
...ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
列番号は0-originで、バイト単位で表されます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_column # => 0
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # first _ lineno -> Integer (12207.0) -
ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
...ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
行番号は1-originです。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//}... -
Matrix
# first _ minor(row , column) -> Matrix (12201.0) -
self から第 row 行と第 column 列を取り除いた行列を返します。
...self から第 row 行と第 column 列を取り除いた行列を返します。
@param row 行
@param column 列
@raise ArgumentError row, column が行列の行数/列数を越えている場合に発生します。... -
REXML
:: Node # find _ first _ recursive {|node| . . . } -> REXML :: Node | nil (12201.0) -
self とその各 element node を引数とし、ブロックを呼び出し、 そのブロックの返り値が真であった最初の node を返します。
...self とその各 element node を引数とし、ブロックを呼び出し、
そのブロックの返り値が真であった最初の node を返します。
見付からなかった場合は nil を返します。... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (9206.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='<'/>
</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 (9206.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://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.get_attribute("att") # => att='<'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9206.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='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first......a.attributes.get_attribute_ns("", "att") # => att='<'
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 (6306.0) -
path で指定されるファイルを開き、string を書き込み、 閉じます。
...path で指定されるファイルを開き、string を書き込み、
閉じます。
ファイルを開くときの mode が "wb: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を使用した場合: どの環境でも正しく保存できる。
IO.binwrite('white.binmode.png', png)
puts IO.binread('white.binmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e...