Module: ConvenientService::RSpec::Matchers::Classes::Results::Base::Entities::Printers

Defined in:
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/null.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/error.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/failure.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_parts.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_step_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_parts.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_service_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_code_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_data_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_step_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_status_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_message_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_service_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb

Defined Under Namespace

Classes: Base, Error, Failure, Null, Success

Class Method Summary collapse

Class Method Details

.create(matcher:) ⇒ ConvenientService::RSpec::Matchers::Classes::Results::Base::Entities::Printers::Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers.rb', line 24

def create(matcher:)
  return Entities::Printers::Null.new(matcher: matcher) unless matcher.result

  case matcher.result.status.to_sym
  when :success
    Entities::Printers::Success.new(matcher: matcher)
  when :failure
    Entities::Printers::Failure.new(matcher: matcher)
  when :error
    Entities::Printers::Error.new(matcher: matcher)
  else
    Entities::Printers::Null.new(matcher: matcher)
  end
end