るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Net::HTTPHeader#sub_type -> String|nil (6126.0)

"text/html" における "html" のようなサブタイプを表す 文字列を返します。

...タイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.sub_type # => "html"
//}...

File::Stat#ftype -> String (6113.0)

ファイルのタイプを表す文字列を返します。

..."directory"
"characterSpecial"
"blockSpecial"
"fifo"
"link"
"socket"

"unknown"


//emlist[例][ruby]{
fs = File::Stat.new($0)
p fs.ftype #=> "file"
p File::Stat.new($:[0]).ftype #=> "directory"
//}


1.8 以降では、属性メソッドがシステムでサポートされていない...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (3228.0)

型が持つソースインターフェイスを取得します。

...ベントの通知元となるインターフェイス)を返します。

@return デフォルトのソースインターフェイスをWIN32OLE_TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1...
...ジについては既
知としています。

# coding : cp932
require 'win32ole'

type
= WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source = type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
e...
...now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.navigate2 'http://www.ruby-lang.org/'
loop do
break if evt.handler.completed
WIN32OLE_EVENT.message_loop
end
ctl.Quit

このプログラムを実行するとWindows...

WIN32OLE_TYPE#helpfile -> String | nil (3019.0)

オブジェクトに関連付けられたヘルプファイルのフルパス名。

...ルのフルパス名を文字列で返します。
ヘルプファイルが未定義の場合はnilを返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
puts tobj.helpfile # => C:\...\VBAXL9.CHM
WIN32OLE.ole_show_help tobj.helpfile, tobj.h...
...てい
ない場合があることに注意してください。

また、返送値はOLEサーバの登録値をそのまま利用するため、Rubyのパス名形式
(ディレクトリ区切りは「/」)ではなく、Windowsのパス名形式(ディレクト
リ区切りは「\」)で...

REXML::DocType#attribute_of(element, attribute) -> String | nil (3013.0)

DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。

...[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS

p doctype.at...
...tribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...

絞り込み条件を変える

REXML::DocType#attributes_of(element) -> [REXML::Attribute] (3013.0)

DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。

...[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS

p doctype.at...
...tributes_of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}...

REXML::DocType#entities -> { String => REXML::Entity } (3013.0)

DTD で宣言されている実体の集合を Hash で返します。

...れています。

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS

p doctype.entities # => { "gt" => #<REXML::Entity: ...>,
# "lt" => #<REXML::Entity: ...>, ... }
p doctype.entities["bar"].to_s # => "<!EN...
...TITY bar \"barbarbarbar\">"
p doctype.entities["gt"].to_s # => "<!ENTITY gt \">\">"
//}...

REXML::DocType#entity(name) -> String | nil (3013.0)

name という実体参照名を持つ実体を文字列で返します。

...つ実体が存在しない場合には nil を返します。

@param name 実体参照名(文字列)

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entity("bar") # => "barbarbar"
p doctype.entity("foo") # => nil
//}...

REXML::DocType#external_id -> String | nil (3013.0)

DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。

...

//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype.name # => "html"
doctype.external_id # => "PUBLIC"

doctype = REXML::Docum...
...ent.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
EOS
doctype.name # => "books"
doctype.external_id # => nil
//}...
<< < 1 2 3 4 ... > >>