Class: ConvenientService::RSpec::Matchers::Classes::Results::Base::Entities::Printers::Success::Commands::GenerateGotJsendAttributesPart

Inherits:
Support::Command
  • Object
show all
Includes:
Support::Delegate, Support::DependencyContainer::Import
Defined in:
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::DependencyContainer::Import

import

Methods included from Support::Delegate::ClassMethodsForForwardable

#delegate

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(printer:) ⇒ 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.



52
53
54
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb', line 52

def initialize(printer:)
  @printer = printer
end

Instance Attribute Details

#printerObject (readonly)

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.



23
24
25
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb', line 23

def printer
  @printer
end

Instance Method Details

#callString

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.

Returns:

  • (String)


61
62
63
64
65
66
67
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb', line 61

def call
  return "" unless result

  return status_part if [chain.used_data?, chain.used_message?, chain.used_code?].none?

  [status_part, data_part, message_part, code_part].reject(&:empty?).join("\n")
end

#chainConvenientService::RSpec::Matchers::Classes::Results::Base::Entities::Chain

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.



30
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb', line 30

delegate :chain, to: :printer

#resultConvenientService::Service::Plugins::HasJSendResult::Entities::Result

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
# File 'lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb', line 37

delegate :result, to: :printer