るりまサーチ

最速Rubyリファレンスマニュアル検索!
600件ヒット [301-400件を表示] (0.075秒)

別のキーワード

  1. win32ole ole_activex_initialize
  2. ri initialize
  3. object initialize
  4. darkfish initialize
  5. _builtin initialize

検索結果

<< < ... 2 3 4 5 6 > >>

Enumerable#min {|a, b| ... } -> object | nil (7.0)

ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...の要素を返すかは不定です。

@param n 取得する要素数。


//emlist[例][ruby]{
class Person
attr_reader :name, :age

def initialize(name, age)
@name = name
@age = age
end
end

people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),...

Enumerable#min(n) {|a, b| ... } -> Array (7.0)

ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...の要素を返すかは不定です。

@param n 取得する要素数。


//emlist[例][ruby]{
class Person
attr_reader :name, :age

def initialize(name, age)
@name = name
@age = age
end
end

people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),...

Fiddle::Importer#struct(signature) -> Class (7.0)

C の構造体型に対応する Ruby のクラスを構築して返します。

...成します。

このメソッドが返すクラスには以下のメソッドが定義されています
* クラスメソッド malloc
* initialize
* to_ptr
* to_i
* 構造体の各メンバへのアクセサ
返されるクラスは Fiddle::CStruct を継承しています。詳しく...

Forwardable#def_delegator(accessor, method, ali = method) -> () (7.0)

メソッドの委譲先を設定します。

...stance_delegator の別名になります。

例:

require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end

def_delegator :@queue, :push, :mypush
end

q = MyQueue.new
q.mypush 42
q.queue # => [42]
q.push 23...

Forwardable#def_instance_delegator(accessor, method, ali = method) -> () (7.0)

メソッドの委譲先を設定します。

...stance_delegator の別名になります。

例:

require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end

def_delegator :@queue, :push, :mypush
end

q = MyQueue.new
q.mypush 42
q.queue # => [42]
q.push 23...

絞り込み条件を変える

Forwardable#delegate(hash) -> () (7.0)

メソッドの委譲先を設定します。

...例:

require 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end

zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last...

Forwardable#instance_delegate(hash) -> () (7.0)

メソッドの委譲先を設定します。

...例:

require 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end

zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (7.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...の引数と同じ Hash を
指定します。

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

class Person
attr :name, :age

def initialize(name, age)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tan...

Kernel#DelegateClass(superclass) -> object (7.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。

...ラスを定義し、
そのクラスを返します。

@param superclass 委譲先となるクラス

例:

//emlist{
require 'delegate'

class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}...
<< < ... 2 3 4 5 6 > >>