るりまサーチ

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

別のキーワード

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

検索結果

<< 1 2 3 ... > >>

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (18345.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...ボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
Net::HTTPResponse オブジェクトは有効な body を
持ちません。

dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
ボディを少し...
...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'...
..., nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (15444.0)

namespace と 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='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute_ns("", "att")...
...# => att='&lt;'
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
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (15432.0)

name という名前の属性を取得します。

...: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='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("a...
...tt") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

StringScanner#get_byte -> String | nil (12374.0)

1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。

...canner#getbyte は将来のバージョンで削除される予定です。
代わりに StringScanner#get_byte を使ってください。

//emlist[例][ruby]{
require 'strscan'

utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte...
...#=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xA4"
p s.get_byte #=> nil
//}...

StringScanner#getbyte -> String | nil (12374.0)

1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。

...canner#getbyte は将来のバージョンで削除される予定です。
代わりに StringScanner#get_byte を使ってください。

//emlist[例][ruby]{
require 'strscan'

utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte...
...#=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xA4"
p s.get_byte #=> nil
//}...

絞り込み条件を変える

Binding#local_variable_get(symbol) -> object (12344.0)

引数 symbol で指定した名前のローカル変数に設定された値を返します。

...bol で指定した名前のローカル変数に設定された値を返します。

@param symbol ローカル変数名を Symbol オブジェクトで指定します。

@raise NameError 引数 symbol で指定したローカル変数が未定義の場合に発生します。

//emlist[例][ruby...
...]{
def foo
a = 1
b
inding.local_variable_get(:a) # => 1
b
inding.local_variable_get(:b) # => NameError
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
b
inding.eval("#{symbol}")
//}

@see Binding#local_variable_set, Binding#local_variable_defined?...

Object#instance_variable_get(var) -> object | nil (12332.0)

オブジェクトのインスタンス変数の値を取得して返します。

...Symbol で指定します。

//emlist[][ruby]{
class Foo
def initialize
@foo = 1
end
end

obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variable_get(:@bar) #=> nil
//}

@see Object#instance_variable_set,Object#...
...instance_variables,Object#instance_variable_defined?...

Module#class_variable_get(name) -> object (12320.0)

クラス/モジュールに定義されているクラス変数 name の値を返します。

...の値を返します。

@param name String または Symbol を指定します。

@raise NameError クラス変数 name が定義されていない場合、発生します。

//emlist[例][ruby]{
class Fred
@@foo = 99
end

def Fred.foo
class_variable_get(:@@foo)
end

p Fred.foo #=> 99
//}...

ARGF.class#getbyte -> Integer | nil (12313.0)

self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。

...)を読み込み整数として返します。
既に EOF に達していれば nil を返します。

ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェ...
...cho "bar" > file2
$ ruby argf.rb file1 file2

ARGF.getbyte # => 102
ARGF.getbyte # => 111
ARGF.getbyte # => 111
ARGF.getbyte # => 10
ARGF.getbyte # => 98
ARGF.getbyte # => 97
ARGF.getbyte # => 114
ARGF.getbyte # => 10
ARGF.getbyte # => nil

@see ARGF.class#getc, ARGF.class#gets...
<< 1 2 3 ... > >>