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
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Boolean?
- #===(other) ⇒ Boolean?
- #empty? ⇒ Boolean
- #initialize(value:, result: nil) ⇒ void
- #to_arguments ⇒ ConveninentService::Support::Arguments
- #to_kwargs ⇒ Hash{Symbol => Object}
- #to_s ⇒ String
Methods included from ConvenientService::Support::Copyable
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
32 33 34 |
# 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 32 def result @result end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
26 27 28 |
# 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 26 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean?
55 56 57 58 59 60 61 62 |
# 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 55 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.
88 89 90 91 92 93 94 95 |
# 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 88 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
47 48 49 |
# 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 47 def empty? value.empty? end |
#initialize(value:, result: nil) ⇒ void
39 40 41 42 |
# 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 39 def initialize(value:, result: nil) @value = value @result = result end |
#to_arguments ⇒ ConveninentService::Support::Arguments
107 108 109 |
# 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 107 def to_arguments @to_arguments ||= Support::Arguments.new(value: value, result: result) end |
#to_kwargs ⇒ Hash{Symbol => Object}
100 101 102 |
# 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 100 def to_kwargs to_arguments.kwargs end |
#to_s ⇒ String
114 115 116 |
# 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 114 def to_s @to_s ||= value.to_s end |