Class: Party::Proxy::Factory
- Inherits:
-
Object
- Object
- Party::Proxy::Factory
- Defined in:
- lib/proxy_party.rb
Instance Attribute Summary collapse
-
#create_method ⇒ Object
readonly
Returns the value of attribute create_method.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(klass, create_method = nil) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(klass, create_method = nil) ⇒ Factory
Returns a new instance of Factory.
10 11 12 13 |
# File 'lib/proxy_party.rb', line 10 def initialize klass, create_method = nil @klass = klass @create_method = create_method end |
Instance Attribute Details
#create_method ⇒ Object (readonly)
Returns the value of attribute create_method.
8 9 10 |
# File 'lib/proxy_party.rb', line 8 def create_method @create_method end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
8 9 10 |
# File 'lib/proxy_party.rb', line 8 def klass @klass end |
Instance Method Details
#create ⇒ Object
15 16 17 |
# File 'lib/proxy_party.rb', line 15 def create create_method ? klass.send(create_method) : klass.new end |