Class: Callme::Scopes::PrototypeScope

Inherits:
Object
  • Object
show all
Defined in:
lib/callme/scopes/prototype_scope.rb

Overview

Prototype scope instantiates new dep instance on each get_dep call

Instance Method Summary collapse

Constructor Details

#initialize(dep_factory) ⇒ PrototypeScope

Constructon

Parameters:

  • dep_factory

    dep factory



7
8
9
# File 'lib/callme/scopes/prototype_scope.rb', line 7

def initialize(dep_factory)
  @dep_factory = dep_factory
end

Instance Method Details

#delete_dep(dep_metadata) ⇒ Object

Delete dep from scope, because Prototype scope doesn’t store dep then do nothing here

Parameters:



23
24
# File 'lib/callme/scopes/prototype_scope.rb', line 23

def delete_dep()
end

#get_dep(dep_metadata) ⇒ Object

Get new dep instance

Parameters:



14
15
16
# File 'lib/callme/scopes/prototype_scope.rb', line 14

def get_dep()
  @dep_factory.create_dep_and_save(, {})
end