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.
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 |
#value ⇒ Object (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?
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
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
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_arguments ⇒ 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_kwargs ⇒ 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_s ⇒ 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 |