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

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/status/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/status/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)


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

Returns:

  • (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

Returns:

  • (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

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/status/concern/instance_methods.rb', line 34

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

#not_error?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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_argumentsConveninentService::Support::Arguments

Returns:

  • (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_kwargsHash{Symbol => Object}

Returns:

  • (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_sString

Returns:

  • (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_symSymbol

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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