るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.009秒)
トップページ > クエリ:sin[x] > 種類:モジュール[x]

別のキーワード

  1. bigdecimal/math sin
  2. math sin
  3. bigmath sin
  4. _builtin sin
  5. cmath sin

ライブラリ

キーワード

検索結果

SingleForwardable (6001.0)

オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。

...d SingleForwardable
g.def_delegator("@out", :puts)
g.puts ...

また、SingleForwardable はクラスやモジュールに対して以下のようにする事もできます。

require 'forwardable'
class Implementation
def self.service
puts "serviced!"
end
end

module
...
...Facade
extend SingleForwardable
def_delegator :Implementation, :service
end

Facade.service # => serviced!

もし Forwardable と SingleForwardable の両方を使いたい場合、
def_instance_delegator と def_single_delegator メソッドの方を呼び出して
ください。...

Singleton (6001.0)

Singleton パターンを提供するモジュールです。

...Singleton パターンを提供するモジュールです。

Mix-in により singleton パターンを提供します。

Sin
gleton モジュールを include することにより、クラスは
高々ひとつのインスタンスしか持たないことが保証されます。

Sin
gleton を M...
...equire 'singleton'

class SomeSingletonClass
in
clude Singleton
#....
end

a = SomeSingletonClass.instance
b = SomeSingletonClass.instance # a and b are same object
p [a,b] # => [#<SomeSingletonClass:0x0000562e6e18ddd0>, #<SomeSingletonClass:0x0000562e6e18ddd0>]
a = SomeSingletonCl...
...ass.new # => NoMethodError (private method `new' called for SomeSingletonClass:Class)...