るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

String#upcase -> String (21214.0)

'a' から 'z' までのアルファベット小文字を大文字に変換した文字列を作成して返します。

...字として認識する」だけであって、
いわゆる全角アルファベットの大文字小文字までは変換しません。

//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}

@see String#upcase!, String#downcase,
String#swapcase, String#capitalize...

String#upcase(*options) -> String (21214.0)

全ての小文字を対応する大文字に置き換えた文字列を返します。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。

...のエンコーディングに依存します。

@param options オプションの詳細は String#downcase を参照してください。

//emlist[例][ruby]{
p "stRIng? STring.".upcase # => "STRING? STRING."
//}

@see String#upcase!, String#downcase,
String#swapcase, String#capitalize...

Symbol#upcase(*options) -> Symbol (18220.0)

小文字を大文字に変換したシンボルを返します。

...小文字を大文字に変換したシンボルを返します。

(self.to_s.upcase.intern と同じです。)

:foo.upcase #=> :FOO

@see String#upcase...

String#upcase!(*options) -> self | nil (9214.0)

全ての小文字を対応する大文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。

...ディングに依存します。

@param options オプションの詳細は String#downcase を参照してください。

//emlist[例][ruby]{
buf = "stRIng? STring."
buf.upcase!
p buf # => "STRING? STRING."
//}

@see String#upcase, String#downcase!,
String#swapcase!, String#capitalize!...

String#upcase! -> self | nil (9114.0)

ASCII 文字列の範囲内で 'a' から 'z' までの アルファベット小文字を全て大文字にします。 このメソッドは self を破壊的に変更して返しますが、 置換が起こらなかった場合は nil を返します。

...識する」だけであって、
いわゆる全角アルファベットの大文字小文字までは変換しません。

//emlist[例][ruby]{
buf = "stRIng? STring."
buf.upcase!
p buf # => "STRING? STRING."
//}

@see String#upcase, String#downcase!,
String#swapcase!, String#capitalize!...

絞り込み条件を変える

WIN32OLE#ole_func_methods -> [WIN32OLE_METHOD] (6207.0)

オブジェクトのファンクション情報をWIN32OLE_METHODの配列として返し ます。

...32OLE_METHODの配列として返し
ます。

ole_func_methodsメソッドは、OLEオートメーションサーバのメソッドのうちファ
ンクション(何らかの機能的な操作)に属するものをWIN32OLE_METHODの
配列として返します。

@return WIN32OLE_METHODの...
...untimeError オートメーションサーバの呼び出しに失敗しました。
型情報ライブラリ(TypeLib)が提供されていない場合などに発生します。

excel = WIN32OLE.new('Excel.Application')
excel.visible = true
excel.ole_func_metho...
...ds.each do |fun|
if fun.name.upcase == 'QUIT'
excel._invoke(fun.dispid, [], [])
break
end
end

@see WIN32OLE#ole_methods, WIN32OLE#ole_get_methods,
WIN32OLE#ole_put_methods...

Data#with(**kwargs) -> Data (6107.0)

self をコピーしたオブジェクトを返します。

...gumentError 存在しないメンバを指定した場合に発生します。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
dog1 = Dog.new("Fred", 5) # => #<data Dog name="Fred", age=5>
dog2 = dog1.with(age: 6) # => #<data Dog name="Fred", age=6>
p dog1 # => #<data Dog...
..."Fred", age=5>
dog3 = dog1.with(type: "Terrier") # => ArgumentError (unknown keyword: :type)

# メンバのオブジェクトはコピーされず、同じオブジェクトを参照する。
dog1.name.upcase!
p dog1 # => #<data Dog name="FRED", age=5>
p dog2 # => #<data Dog name="FRED", age=6>
//...
...}

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

Hash#fetch_values(key, ...) -> [object] (6107.0)

引数で指定されたキーに関連づけられた値の配列を返します。

...ます。

//emlist[例][ruby]{
h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }

h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "B...
...IRD"]
//}

@see Hash#values_at, Hash#fetch...

Hash#fetch_values(key, ...) { |key| ... } -> [object] (6107.0)

引数で指定されたキーに関連づけられた値の配列を返します。

...ます。

//emlist[例][ruby]{
h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }

h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "B...
...IRD"]
//}

@see Hash#values_at, Hash#fetch...

Hash#to_h -> self | Hash (6107.0)

self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。

...h オブジェクトに変換します。

//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true

class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.class # => MyHash
p my_hash.to_h.class # => Hash
//}

ブロックを指定す...
...ると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } # => {"A"=>65, "B"=>66}
//}

@see Enumerable#map...

絞り込み条件を変える

Hash#to_h {|key, value| block } -> Hash (6107.0)

self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。

...h オブジェクトに変換します。

//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true

class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.class # => MyHash
p my_hash.to_h.class # => Hash
//}

ブロックを指定す...
...ると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } # => {"A"=>65, "B"=>66}
//}

@see Enumerable#map...

Object#then -> Enumerator (6107.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパ...
...quire 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件...
...にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

Object#then {|x| ... } -> object (6107.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパ...
...quire 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件...
...にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

OpenStruct#to_h -> { Symbol => object } (6107.0)

self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返 します。

...

//emlist[例][ruby]{
require 'ostruct'
data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
data.to_h # => {:country => "Australia", :capital => "Canberra" }
data.to_h {|name, value| [name.to_s, value.upcase] }
# => {"country" => "AUSTRALIA", "capital" => "CANBE...
<< 1 2 3 ... > >>