126件ヒット
[1-100件を表示]
(0.078秒)
ライブラリ
- ビルトイン (24)
-
digest
/ sha2 (24) - forwardable (24)
- json (24)
-
net
/ http (12) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
-
Digest
:: SHA2 (24) - Hash (24)
-
JSON
:: State (24) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
モジュール
- Forwardable (24)
-
Net
:: HTTPHeader (12)
キーワード
-
block
_ length (12) - delegate (12)
-
digest
_ length (12) - fetch (12)
-
instance
_ delegate (12) - size (12)
-
to
_ h (12) -
to
_ hash (12) - truncate (18)
検索結果
先頭5件
-
Hash
# length -> Integer (21114.0) -
ハッシュの要素の数を返します。
...ハッシュの要素の数を返します。
//emlist[][ruby]{
h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 }
h.length #=> 4
h.size #=> 4
h.delete("a") #=> 200
h.length #=> 3
h.size #=> 3
//}... -
Digest
:: SHA2 # block _ length -> Integer (9102.0) -
ダイジェストのブロック長を返します。
ダイジェストのブロック長を返します。 -
Digest
:: SHA2 # digest _ length -> Integer (9102.0) -
ダイジェストのハッシュ値のバイト長を返します。
ダイジェストのハッシュ値のバイト長を返します。 -
Hash
# size -> Integer (6014.0) -
ハッシュの要素の数を返します。
...ハッシュの要素の数を返します。
//emlist[][ruby]{
h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 }
h.length #=> 4
h.size #=> 4
h.delete("a") #=> 200
h.length #=> 3
h.size #=> 3
//}... -
JSON
:: State # to _ hash -> Hash (3207.0) -
自身をハッシュに変換します。
...quire "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# :depth=>0,
# :buffer_initial_length=>1024}
//}... -
Shell
# truncate(path , length) -> 0 (3108.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: CommandProcessor # truncate(path , length) -> 0 (3108.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: Filter # truncate(path , length) -> 0 (3108.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (131.0) -
key ヘッダフィールドを返します。
...key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられてい.......fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-length">
end
//}
//emlist[例 key , default を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") #......=> "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Forwardable
# delegate(hash) -> () (113.0) -
メソッドの委譲先を設定します。
...@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
例:
require '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"...