るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Rake::PackageTask#name -> String (18327.0)

バージョン情報を含まないパッケージの名前を返します。

...バージョン情報を含まないパッケージの名前を返します。

//emlist[][ruby]{
# Rakefile での記載例とする
require
'rake/packagetask'

Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.name # => "sample"
end
//}...

REXML::Attribute#to_string -> String (12443.0)

"name='value'" という形式の文字列を返します。

..."name='value'" という形式の文字列を返します。

//emlist[][ruby]{
require
'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}...

ERB#filename -> String (12320.0)

エラーメッセージを表示する際のファイル名を取得します。

...エラーメッセージを表示する際のファイル名を取得します。

//emlist[例][ruby]{
require
'erb'
filename = 'example.rhtml'
erb = ERB.new(File.read(filename))
erb.filename # => nil
erb.filename = filename
erb.filename # =>"example.rhtml"
//}...

ERB#filename= -> String (12320.0)

エラーメッセージを表示する際のファイル名を設定します。

...

filename を設定しておくことにより、エラーが発生した eRuby スクリプトの特定が容易になります。filename を設定していない場合は、エラー発生箇所は「 (ERB) 」という出力となります。

//emlist[例][ruby]{
require
'erb'
filename = 'e...
...xample.rhtml'
erb = ERB.new(File.read(filename))
erb.filename # => nil
erb.filename = filename
erb.filename # =>"example.rhtml"
//}...

REXML::Attributes#namespaces -> { String => String } (9521.0)

self の中で宣言されている名前空間の集合を返します。

...f の中で宣言されている名前空間の集合を返します。

返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。

//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

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

絞り込み条件を変える

REXML::Attribute#namespace(arg = nil) -> String | nil (9420.0)

属性の名前空間の URI を返します。

...URI を返します。

URI が定義されていない場合は nil を返します。

@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlist[][ruby]{
require
'rexm...
...l/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

Addrinfo#canonname -> String|nil (9356.0)

カノニカル名を文字列で返します。

...には nil を返します。

カノニカル名は Addrinfo.getaddrinfo に Socket::AI_CANONINAME
を指定した場合にセットされます。

require
'socket'

list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
p list[0] #=> #<Addrinfo: 221....
...186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org:80)>
p list[0].canonname #=> "carbon.ruby-lang.org"...

OptionParser#program_name -> String (9327.0)

プログラムの名前を文字列で返します。

...字列で返します。

デフォルトは $0 が使われます。

@return プログラムの名前を文字列で返します。

//emlist[例][ruby]{
require
"optparse"

OptionParser.new do |opts|
p $0 # => /path/to/filename.rb
p opts.program_name # => filename
end
//}...

Pathname#binread(*args) -> String | nil (9320.0)

IO.binread(self.to_s, *args)と同じです。

...IO.binread(self.to_s, *args)と同じです。

//emlist[例][ruby]{
require
"pathname"

pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(2...
...0, 10) # => "ne one\nThis is line "
//}

@see IO.binread...
<< 1 2 3 ... > >>