Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message::Concern::InstanceMethods

Includes:
ConvenientService::Support::Copyable
Defined in:
lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConvenientService::Support::Copyable

#copy

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



27
28
29
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 27

def result
  @result
end

#valueObject (readonly)

Returns the value of attribute value.



21
22
23
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 21

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


50
51
52
53
54
55
56
57
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 50

def ==(other)
  return unless other.instance_of?(self.class)

  return false if result.class != other.result.class
  return false if value != other.value

  true
end

#===(other) ⇒ Boolean?

Note:

Message#=== allows to use RSpec expectation matchers and RSpec mocks arguments matchers for comparison.



83
84
85
86
87
88
89
90
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 83

def ===(other)
  return unless other.instance_of?(self.class)

  return false if result.class != other.result.class
  return false unless value === other.value

  true
end

#empty?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 42

def empty?
  value.empty?
end

#initialize(value:, result: nil) ⇒ void

Parameters:



34
35
36
37
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 34

def initialize(value:, result: nil)
  @value = value
  @result = result
end

#to_argumentsConveninentService::Support::Arguments

Returns:

  • (ConveninentService::Support::Arguments)


102
103
104
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 102

def to_arguments
  @to_arguments ||= Support::Arguments.new(value: value, result: result)
end

#to_kwargsHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})


95
96
97
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 95

def to_kwargs
  to_arguments.kwargs
end

#to_sString

Returns:

  • (String)


109
110
111
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb', line 109

def to_s
  @to_s ||= value.to_s
end