Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Status::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/status/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?
- #error? ⇒ Boolean
- #failure? ⇒ Boolean
- #in?(statuses) ⇒ Boolean
- #initialize(value:, result: nil) ⇒ void
- #not_error? ⇒ Boolean
- #not_failure? ⇒ Boolean
- #not_success? ⇒ Boolean
- #success? ⇒ Boolean
- #to_arguments ⇒ ConveninentService::Support::Arguments
- #to_kwargs ⇒ Hash{Symbol => Object}
- #to_s ⇒ String
- #to_sym ⇒ Symbol
- #unsafe_error? ⇒ Boolean
- #unsafe_failure? ⇒ Boolean
- #unsafe_not_error? ⇒ Boolean
- #unsafe_not_failure? ⇒ Boolean
- #unsafe_not_success? ⇒ Boolean
- #unsafe_success? ⇒ Boolean
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/status/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/status/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/status/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 |
#error? ⇒ Boolean
69 70 71 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 69 def error? value == :error end |
#failure? ⇒ Boolean
62 63 64 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 62 def failure? value == :failure end |
#in?(statuses) ⇒ Boolean
140 141 142 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 140 def in?(statuses) statuses.any? { |status| self == status } 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/status/concern/instance_methods.rb', line 34 def initialize(value:, result: nil) @value = value @result = result end |
#not_error? ⇒ Boolean
111 112 113 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 111 def not_error? value != :error end |
#not_failure? ⇒ Boolean
104 105 106 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 104 def not_failure? value != :failure end |
#not_success? ⇒ Boolean
97 98 99 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 97 def not_success? value != :success end |
#success? ⇒ Boolean
55 56 57 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 55 def success? value == :success end |
#to_arguments ⇒ ConveninentService::Support::Arguments
154 155 156 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 154 def to_arguments @to_arguments ||= Support::Arguments.new(value: value, result: result) end |
#to_kwargs ⇒ Hash{Symbol => Object}
147 148 149 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 147 def to_kwargs to_arguments.kwargs end |
#to_s ⇒ String
161 162 163 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 161 def to_s @to_s ||= value.to_s end |
#to_sym ⇒ Symbol
168 169 170 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 168 def to_sym @to_sym ||= value.to_sym end |
#unsafe_error? ⇒ Boolean
90 91 92 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 90 def unsafe_error? value == :error end |
#unsafe_failure? ⇒ Boolean
83 84 85 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 83 def unsafe_failure? value == :failure end |
#unsafe_not_error? ⇒ Boolean
132 133 134 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 132 def unsafe_not_error? value != :error end |
#unsafe_not_failure? ⇒ Boolean
125 126 127 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 125 def unsafe_not_failure? value != :failure end |
#unsafe_not_success? ⇒ Boolean
118 119 120 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 118 def unsafe_not_success? value != :success end |
#unsafe_success? ⇒ Boolean
76 77 78 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb', line 76 def unsafe_success? value == :success end |