Class: ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock Private
- Inherits:
-
Object
- Object
- ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
- Defined in:
- lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #==(other) ⇒ Boolean? private
- #and_code(code) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #and_data(data) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #and_message(message) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #for(service_class, arguments) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #initialize(status:, service_class: nil, arguments: nil, chain: {}) ⇒ void constructor private
- #register(&block) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock (also: #apply) private
- #result ⇒ ConvenientService::Service private
- #unregister ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock (also: #revert) private
- #with_code(code) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #with_data(data) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
- #with_message(message) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock private
Constructor Details
#initialize(status:, service_class: nil, arguments: nil, chain: {}) ⇒ void
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.
25 26 27 28 29 30 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 25 def initialize(status:, service_class: nil, arguments: nil, chain: {}) @status = status @service_class = service_class @arguments = arguments @chain = chain end |
Instance Method Details
#==(other) ⇒ Boolean?
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.
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 147 def ==(other) return unless other.instance_of?(self.class) return false if status != other.status return false if service_class != other.service_class return false if arguments != other.arguments return false if chain != other.chain true end |
#and_code(code) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
95 96 97 98 99 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 95 def and_code(code) chain[:code] = code self end |
#and_data(data) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
75 76 77 78 79 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 75 def and_data(data) chain[:data] = data self end |
#and_message(message) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
85 86 87 88 89 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 85 def () chain[:message] = self end |
#for(service_class, arguments) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
37 38 39 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 37 def for(service_class, arguments) self.class.new(status: status, service_class: service_class, arguments: arguments, chain: chain) end |
#register(&block) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock Also known as: apply
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.
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 105 def register(&block) Commands::SetServiceStubbedResult[service: service_class, arguments: arguments, result: result] return self unless block begin yield ensure Commands::DeleteServiceStubbedResult[service: service_class, arguments: arguments] end end |
#result ⇒ ConvenientService::Service
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.
139 140 141 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 139 def result service_class.__send__(status, **kwargs).copy(overrides: {kwargs: {stubbed_result: true}}) end |
#unregister ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock Also known as: revert
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.
125 126 127 128 129 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 125 def unregister Commands::DeleteServiceStubbedResult[service: service_class, arguments: arguments] self end |
#with_code(code) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
65 66 67 68 69 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 65 def with_code(code) chain[:code] = code self end |
#with_data(data) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
45 46 47 48 49 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 45 def with_data(data) chain[:data] = data self end |
#with_message(message) ⇒ ConvenientService::Service::Plugins::CanHaveStubbedResults::Entities::ResultMock
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.
55 56 57 58 59 |
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/entities/result_mock.rb', line 55 def () chain[:message] = self end |