るりまサーチ

最速Rubyリファレンスマニュアル検索!
6793件ヒット [6701-6793件を表示] (0.092秒)
トップページ > クエリ:>[x] > クエリ:Hash[x]

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. module >
  5. integer >

ライブラリ

クラス

オブジェクト

キーワード

検索結果

<< < ... 66 67 68 >>

cgi (42.0)

CGI プログラムの支援ライブラリです。

...るには CGI#params を使います。

//emlist[例][ruby]{
require "cgi"
cgi = CGI.new
params = cgi.params
//}

また CGI#params は毎回同じ Hash オブジェクトを返すので
以下のような使いかたもできます。

//emlist[][ruby]{
cgi.params['new_field_name'] = ["value"] #...
...kies
cookie.expires = Time.now + 30
end
cgi.out("cookie" => cgi.cookies){"string"}

cgi.cookies # { "name1" => cookie1, "name2" => cookie2, ... }

require "cgi"
cgi = CGI.new
cgi.cookies['name'].expires = Time.now + 30
cgi.out("cookie" => cgi.cookies['name']){"string"}
//}

==== クライアント...
...s: " + cgi.params.inspect + "\n" +
"cookies: " + cgi.cookies.inspect + "\n" +
ENV.collect() do |key, value|
key + " --> " + value + "\n"
end.join("")
)
end
end
end
end

# HTML生成メソッドを追加
CGI.new("html3") # html3.2
CGI.n...

NEWS for Ruby 2.4.0 (36.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...になりました。
half には :even, :up, :down が指定可能です。 12548 12958 12953

* Hash
* Hash#compact, Hash#compact! を追加 11818
* Hash#transform_values Hash#transform_values! を追加 12512

* Integer
* Fixnum と Bignum は Integer に統合されまし...
...字として許可しなくなりました 12791

* csv
* liberal_parsing オプションを追加 11839

* ipaddr
* IPAddr#==, IPAddr#<=> で引数のオブジェクトを IPAddr に変換する処理に失敗しても例外が発生しなくなりました
12799

* irb
* Bi...
...場合、
コンパイルエラーになります。
//emlist{
# 0のクラスはInteger
0.class # => Integer
Fixnum # => Integer
Bignum # => Integer

# 以下の2つは同じ
obj.kind_of?(Fixnum)
obj.kind_of?(Integer)

/* Cレベ...

Numeric (36.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...Float などの数値クラス
は Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメ...
...れているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれば、数値クラスのそのほかのメソッドが
適切に定義されることを意図して提供されてい...
...----------------------------------------
gcdlcm | - o - - - - -
hash
| - - - o o o o
i | o - -...
...gcd | - o - - -
gcdlcm | - o - - -
hash
| - - o o o
i | o - - - -...

irb/completion (36.0)

irb の completion 機能を提供するライブラリです。

...):001:0> in
in inspect instance_eval
include install_alias_method instance_of?
initialize install_aliases instance_variables
irb(main):001:0> inspect
"main"
irb(main):002:0> foo = Object.new
#<Object:0x4027146c>

"変...
...b] を押すと, そのオブジェクトのメソッド一覧がでます.

irb(main):003:0> foo.
foo.== foo.frozen? foo.protected_methods
foo.=== foo.hash foo.public_methods
foo.=~ foo.id foo.resp...

tsort (36.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

...equire 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components
#=> [[4], [2, 3], [1]]
/...
...em arg
end

m = Make.new
m.rule(%w[t1]) { command 'date > t1' }
m.rule(%w[t2]) { command 'date > t2' }
m.rule(%w[t3]) { command 'date > t3' }
m.rule(%w[t4], %w[t1 t3]) { command 'cat t1 t3 > t4' }
m.rule(%w[t5], %w[t4 t2]) { command 'cat t4 t2 > t5' }
m.build('t5')
//}

=== Bugs

tsort という名...

絞り込み条件を変える

rexml/parsers/ultralightparser (30.0)

パース結果を配列で作られた木構造により返すパーサ。

...されます。

: [:start_element, 親ノード, 要素名, 属性, *子ノード]
XML要素。属性は { 属性名文字列 => 属性値文字列 } という Hash
子ノードの配列は node[4..-1] で得られる。
: [:text, 正規化文字列]
テキストノード
: [:processing_in...
...ルト値, 宣言文字列]
DTDの属性リスト宣言。属性名とデフォルト値 は { 属性名文字列 => デフォルト値文字列(なければnil) } という Hash
: [:elementdecl, 宣言文字列]
DTDの要素宣言
: [:entitydecl, *パラメータ]
DTDの実体宣言
: [:notat...
...TF-8" ?>
<root>
<a n="1">xyz</a>
<b m="2" />
</root>
XML
pp parser.parse
# >> [[:xmldecl, "1.0", "UTF-8", nil],
# >> [:text, "\n"],
# >> [:start_element,
# >> [...],
# >> "root",
# >> {},
# >> [:text, "\n "],
# >> [:start_element, [...], "a", {"n"=>"1"}, [:text, "xyz"]],
# >> [:te...

rexml/parsers/pullparser (24.0)

プル方式の XML パーサ。

...定することが可能です。

: start_element (要素名, 属性)
XML要素の開始タグ。属性は { 属性名文字列 => 属性値文字列 } という Hash
: end_element (要素名)
XML要素の終了タグ
: text (正規化文字列, 非正規化文字列)
テキストノード
:...
...ルト値, 宣言文字列)
DTDの属性リスト宣言。属性名とデフォルト値 は { 属性名文字列 => デフォルト値文字列(なければnil) } という Hash
: elementdecl (宣言文字列)
DTDの要素宣言
: entitydecl
DTDの実体宣言
: notationdecl (記法名文字...
...ncoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCTYPE root SYSTEM "foo" [
<!ELEMENT root (a+)>
<!ELEMENT a>
<!ENTITY bar "barbarbarbar">
<!ATTLIST a att CDATA #REQUIRED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENTITY % HTM...

sprintf フォーマット (24.0)

sprintf フォーマット === sprintf フォーマット

...の書式です。[] で囲まれた部分は省略可
能であることを示しています。

%[nth$][フラグ][幅][.精度]指示子
%[<name>][フラグ][幅][.精度]指示子

`%' 自身を出力するには `%%' とします。

以下それぞれの要素に関して説明します。...
...が付加されません。

//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x", 10) #=> "0xa"
p sprintf("%#X", 10) #=> "0XA"
//}

浮動小数点数 (f, e, E, g, G) に対しては必ず...
...
//emlist[][ruby]{
p sprintf("%5.2f", 1) #=> " 1.00"
p sprintf("%*.*f", 5, 2, 1) #=> " 1.00"
p sprintf("%1$*2$.*3$f", 1, 5, 2) #=> " 1.00"
//}

: %<name>

Symbol のインスタンス name をキーとする Hash を引数にした場合、
対応する値をフォーマッ...

xmlrpc (24.0)

XML-RPC を扱うためのライブラリです。

...ossible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
* Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
* SandStorm component architecture Client interface

=== Choosing a different XML Parser or XML Writer

The examples above...
...r (which is now since 1.8
REXMLStreamParser) and a default XML writer. If you want to use a different
XML parser, then you have to call the <i>set_parser</i> method of
XMLRPC::Client instances or instances of subclasses of
XMLRPC::BasicServer or by editing xmlrpc/config.rb.

Client Example:

req...
...is ~350 (!) times faster than
NQXMLTreeParser and still ~18 times as fast as XMLTreeParser.

You can change the XML-writer by calling method <i>set_writer</i>.

=== 参考

* http://www.linux.or.jp/JF/JFdocs/XML-RPC-HOWTO/index.html
* http://www.linux.or.jp/JF/JFdocs/XML-RPC-HOWTO/xmlrpc-howto-r...
<< < ... 66 67 68 >>