るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

検索結果

<< < ... 5 6 7 >>

プログラム・文・式 (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='&lt;'/>
&amp;&amp; <!-- 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\...
<< < ... 5 6 7 >>