Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code::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/code/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?
- #initialize(value:, result: nil) ⇒ void
- #to_arguments ⇒ ConveninentService::Support::Arguments
- #to_kwargs ⇒ Hash{Symbol => Object}
- #to_s ⇒ String
- #to_sym ⇒ Symbol
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/code/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/code/concern/instance_methods.rb', line 21 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean?
43 44 45 46 47 48 49 50 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 43 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:
Code#===
allows to use RSpec expectation matchers and RSpec mocks arguments matchers for comparison.
100 101 102 103 104 105 106 107 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 100 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 |
#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/code/concern/instance_methods.rb', line 34 def initialize(value:, result: nil) @value = value @result = result end |
#to_arguments ⇒ ConveninentService::Support::Arguments
119 120 121 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 119 def to_arguments @to_arguments ||= Support::Arguments.new(value: value, result: result) end |
#to_kwargs ⇒ Hash{Symbol => Object}
112 113 114 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 112 def to_kwargs to_arguments.kwargs end |
#to_s ⇒ String
126 127 128 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 126 def to_s @to_s ||= value.to_s end |
#to_sym ⇒ Symbol
133 134 135 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb', line 133 def to_sym @to_sym ||= value.to_sym end |