Class: ConvenientService::RSpec::Helpers::Classes::WrapMethod

Inherits:
Support::Command
  • Object
show all
Defined in:
lib/convenient_service/rspec/helpers/classes/wrap_method.rb,
lib/convenient_service/rspec/helpers/classes/wrap_method/exceptions.rb,
lib/convenient_service/rspec/helpers/classes/wrap_method/entities/wrapped_method.rb

Defined Under Namespace

Modules: Entities, Exceptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(entity, method, observe_middleware:) ⇒ void

Parameters:

  • entity (Object)

    Can be any type.

  • method (Symbol, String)
  • observe_middleware (Class)


35
36
37
38
39
# File 'lib/convenient_service/rspec/helpers/classes/wrap_method.rb', line 35

def initialize(entity, method, observe_middleware:)
  @entity = entity
  @method = method
  @observe_middleware = observe_middleware
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



15
16
17
# File 'lib/convenient_service/rspec/helpers/classes/wrap_method.rb', line 15

def entity
  @entity
end

#methodObject (readonly)

Returns the value of attribute method.



21
22
23
# File 'lib/convenient_service/rspec/helpers/classes/wrap_method.rb', line 21

def method
  @method
end

#observe_middlewareObject (readonly)

Returns the value of attribute observe_middleware.



27
28
29
# File 'lib/convenient_service/rspec/helpers/classes/wrap_method.rb', line 27

def observe_middleware
  @observe_middleware
end

Instance Method Details

#callConvenientService::RSpec::Helpers::Classes::Entities::WrappedMethod

Returns:

  • (ConvenientService::RSpec::Helpers::Classes::Entities::WrappedMethod)


44
45
46
# File 'lib/convenient_service/rspec/helpers/classes/wrap_method.rb', line 44

def call
  Entities::WrappedMethod.new(entity: entity, method: method, observe_middleware: observe_middleware)
end