680件ヒット
[601-680件を表示]
(0.059秒)
別のキーワード
クラス
- CSV (36)
- Date (24)
-
Encoding
:: Converter (12) - Enumerator (78)
- Float (22)
- Integer (36)
- Object (30)
-
Prime
:: EratosthenesGenerator (36) -
REXML
:: Child (24) -
REXML
:: Element (12) -
RubyVM
:: InstructionSequence (36) - String (48)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - >> (12)
- Enumerator (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - Numeric (12)
- Proc (12)
- Ruby プログラムの実行 (12)
- debug (12)
- disasm (12)
- disassemble (12)
- feed (12)
- filter (36)
- lambda (18)
- load (15)
- loop (20)
- next! (12)
-
next
_ element (12) -
next
_ float (11) -
next
_ sibling= (12) -
next
_ values (12) -
next
_ year (12) - parse (12)
- peek (12)
-
peek
_ values (12) - pred (12)
-
prev
_ float (11) -
previous
_ sibling= (12) -
primitive
_ errinfo (12) - proc (19)
- produce (6)
- rewind (24)
-
rexml
/ parsers / pullparser (12) -
ruby 1
. 8 . 4 feature (12) - succ (36)
- succ! (12)
- then (14)
-
to
_ a (12) -
yield
_ self (16) - プログラム・文・式 (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- リテラル (12)
- 制御構造 (12)
- 字句構造 (12)
- 手続きオブジェクトの挙動の詳細 (12)
検索結果
先頭5件
-
プログラム・文・式 (18.0)
-
プログラム・文・式 * exp * terminate
...。
例:
print "hello world!\n"
===[a:exp] 式
例:
true
(1+2)*3
foo()
if test then ok else ng end
Ruby の式には、spec/variables、さまざまなspec/literal、それらの
spec/operator、if や while などのspec/control、spec/call、
spec/......グすることができます。
式は評価されると値(評価値)が定まり、その値を返します。
ただし、return、break, next といったものは値を返しません。これらは評価された
時点で制御が移ってしまいます。
空の式 () は nil を返......によるグルーピングを行うことで普
通の式として使用することができます。
===[a:terminate] プログラムの終り
Rubyインタプリタはプログラムを読みこんでいる際に以下のものに出会うとそこ
で読みこみを終了します。
*... -
Encoding
:: Converter # primitive _ errinfo -> Array (12.0) -
直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
...g::Converter#convert を用いている場合にも取得することはできますが、有用な使い方は難しいでしょう。
//emlist[][ruby]{
# \xff is invalid as EUC-JP.
ec = Encoding::Converter.new("EUC-JP", "Shift_JIS")
ec.primitive_convert(src="\xff", dst="", nil, 10)
p ec.primitive......\xd8\x00\x00@ is invalid as UTF-16BE because
# no low surrogate after high surrogate (\xd8\x00).
# It is detected by 3rd byte (\00) which is part of next character.
# So the high surrogate (\xd8\x00) is discarded and
# the 3rd byte is read again later.
# Since the byte is buffered in ec, it is dropp... -
Float
# prev _ float -> Float (12.0) -
浮動小数点数で表現可能な self の前の値を返します。
...oat と (-Float::INFINITY).prev_float
は -Float::INFINITY を返します。Float::NAN.prev_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.prev_float # => 0.009999999999999998
p 1.0.prev_float # => 0.9999999999999999
p 100.0.prev_float # => 99.99999999999999
p 0.01 - 0.01.......47ae147ae146dp-7 0.009999999999999976
# 0x1.47ae147ae146cp-7 0.009999999999999974
# 0x1.47ae147ae146bp-7 0.009999999999999972
# 0x1.47ae147ae146ap-7 0.00999999999999997
# 0x1.47ae147ae1469p-7 0.009999999999999969
# 0x1.47ae147ae1468p-7 0.009999999999999967
//}
@see Float#next_float... -
Integer
# pred -> Integer (12.0) -
self から -1 した値を返します。
...self から -1 した値を返します。
//emlist[][ruby]{
1.pred #=> 0
(-1).pred #=> -2
//}
@see Integer#next... -
Psych
. parse(yaml , filename = nil) -> Psych :: Nodes :: Document (12.0) -
YAML ドキュメントをパースし、YAML の AST を返します。
...ist[例][ruby]{
Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Document:...>
begin
Psych.parse("--- `", "file.txt")
rescue Psych::SyntaxError => ex
p ex.file # => 'file.txt'
p ex.message # => "(file.txt): found character that cannot start any token while scanning for the next token at... -
REXML
:: Child # previous _ sibling=(other) (12.0) -
other を self の前の隣接ノードとします。
...self の前に
other を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d
p a.to_s # => "<a><d/><b/>... -
rexml
/ parsers / pullparser (12.0) -
プル方式の XML パーサ。
...andalone ("yes" | "no" | nil))
XML宣言
: externalentity (エンティティ文字列)
doctype内のパラメータ実体参照。
//emlist[][ruby]{
require 'rexml/parsers/pullparser'
xml = <<EOS
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCT......att='1' bar:att='2' att='<'/>
&& <!-- comment here--> &bar;
</root>
EOS
parser = REXML::Parsers::PullParser.new(xml)
while parser.has_next?
p parser.pull
end
# >> xmldecl: ["1.0", "UTF-8", nil]
# >> text: ["\n", "\n"]
# >> processing_instruction: ["xml-stylesheet", " type=\"text/css\...
