Class: Injectable::Dependency

Inherits:
Struct
  • Object
show all
Defined in:
lib/injectable/dependency.rb

Overview

Initialize a dependency based on the options or the block passed

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def block
  @block
end

#callObject

Returns the value of attribute call

Returns:

  • (Object)

    the current value of call



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def call
  @call
end

#classObject

Returns the value of attribute class

Returns:

  • (Object)

    the current value of class



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def class
  @class
end

#depends_onObject

Returns the value of attribute depends_on

Returns:

  • (Object)

    the current value of depends_on



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def depends_on
  @depends_on
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def name
  @name
end

#withObject

Returns the value of attribute with

Returns:

  • (Object)

    the current value of with



3
4
5
# File 'lib/injectable/dependency.rb', line 3

def with
  @with
end

Instance Method Details

#instance(args: [], namespace: nil) ⇒ Object



4
5
6
7
# File 'lib/injectable/dependency.rb', line 4

def instance(args: [], namespace: nil)
  args = wrap_args(args)
  wrap_call build_instance(args, namespace: namespace)
end