るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

REXML::DocType#name -> String (27320.0)

ルート要素名を返します。

...ルート要素名を返します。

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

Module#ruby2_keywords(method_name, ...) -> nil (24664.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments...
...argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through th...
...ethod to
other methods.

T
his should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

T
his method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby...

Struct#deconstruct_keys(array_of_names) -> Hash (24425.0)

self のメンバの名前と値の組を Hash で返します。

...aram array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_keys...
...:address])
h # => {:zip=>12345, :address=>"123 Maple, Anytown NC"}

# 引数が nil の場合は全てのメンバを返します。
h = joe.deconstruct_keys(nil)
h # => {:name=>"Joseph Smith, Jr.", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}

[注意] 本メソッドの記述は Struct...
...下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。

@see d:spec/pattern_matching#matching_non_primitive_objects...

Pathname#each_entry {|pathname| ... } -> nil (21413.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...r.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。


//emlist[例][ruby]{
r
equire "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname...
...:opt>
//}

@see Dir.foreach...
...r.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname...
...:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Dir.foreach...

Symbol#name -> String (21326.0)

シンボルに対応する文字列を返します。

...シンボルに対応する文字列を返します。

Symbol#to_sと違って freeze された文字列を返します。

//emlist[][ruby]{
p :fred.name # => "fred"
p :fred.name.frozen? # => true
p :fred.to_s # => "fred"
p :fred.to_s.frozen? # => false
//}

@see Symbol#to_s...

絞り込み条件を変える

Pathname#each_entry -> Enumerator (21313.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...r.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname...
...:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Dir.foreach...

MatchData#named_captures(symbolize_names: false) -> Hash (18519.0)

名前付きキャプチャをHashで返します。

...@param symbolize_names 真を指定するとハッシュのキーを文字列ではなくシンボルにします。デフォルトは偽です。

//emlist[例][ruby]{
m = /(?<a>.)(?<b>.)/.match("01")
m.named_captures # => {"a" => "0", "b" => "1"}

m = /(?<a>.)(?<b>.)?/.match("0")
m.named_captures...
...", "b" => nil}

m = /(?<a>.)(?<a>.)/.match("01")
m.named_captures # => {"a" => "1"}

m = /(?<a>x)|(?<a>y)/.match("x")
m.named_captures # => {"a" => "x"}

m = /(?<a>.)(?<a>.)/.match("01")
m.named_captures(symbolize_names: true) #=> {:a => "1"}
//}

@see MatchData#captures, MatchData#deconstruct_keys...

Pathname#relative_path_from(base_directory) -> Pathname (18513.0)

base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。

...e_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。

パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。

self が相対パスなら base_directory...
...絶対パスなら
base_directory も絶対パスでなければなりません。

@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。

@raise ArgumentError Windows上でドライブが違うなど、base_directory から self への相対パ...
...スが求められないときに例外が発生します。

//emlist[例][ruby]{
r
equire 'pathname'

path = Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")

path.relative_path_from(base) # => #<Pathname:foo>
//}...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (18497.0)

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

...す。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるインターフェイス)を返します。

@return デフォ...
...TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は空配列を返します。

t
obj = WIN32OLE_T...
...YPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
t
obj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]

WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返されたインターフェイスが選択されます。

次のサンプル...

WIN32OLE#setproperty(name, args..., val) -> () (18445.0)

オブジェクトのプロパティを設定します。

...ロパティ
Rubyの属性に相当)を設定します。

なお、OLEオートメーションの仕様により、プロパティ名の大文字、小文字は区
別されません。

@param name プロパティ名を文字列またはシンボルで指定します。
@param val プロパ...
...@param args 集合的なプロパティに対する設定項目を特定するための引数を指
定します。
@raise WIN32OLERuntimeError オートメーションサーバの呼び出しに失敗しました。
理由はメッセージのHRESULTを調...
...ティはRubyの属性と異なり、パラメータを取るこ
とができます。

たとえばExcelのWorksheetオブジェクトのCellsプロパティは桁位置と行番号の
2つのパラメータを取ります。

これはVBでは次のように記述できます。

sheet.Cells(1,...

絞り込み条件を変える

WIN32OLE#setproperty(name, val) -> () (18445.0)

オブジェクトのプロパティを設定します。

...ロパティ
Rubyの属性に相当)を設定します。

なお、OLEオートメーションの仕様により、プロパティ名の大文字、小文字は区
別されません。

@param name プロパティ名を文字列またはシンボルで指定します。
@param val プロパ...
...@param args 集合的なプロパティに対する設定項目を特定するための引数を指
定します。
@raise WIN32OLERuntimeError オートメーションサーバの呼び出しに失敗しました。
理由はメッセージのHRESULTを調...
...ティはRubyの属性と異なり、パラメータを取るこ
とができます。

たとえばExcelのWorksheetオブジェクトのCellsプロパティは桁位置と行番号の
2つのパラメータを取ります。

これはVBでは次のように記述できます。

sheet.Cells(1,...

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

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

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

返される文字列は非正規化(REXML::Entity#unnormalized 参照)
された文字列が返されます。

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
//}...
<< 1 2 3 ... > >>