Class: ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::And Private

Inherits:
Base
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#complex_if?, #else?, #empty?, #group?, #if?, #not?, #or?, #scalar?, #steps

Methods included from ConvenientService::Support::Copyable

#copy

Methods included from ConvenientService::Support::Concern

included

Constructor Details

#initialize(left_expression, right_expression) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 32

def initialize(left_expression, right_expression)
  @left_expression = left_expression
  @right_expression = right_expression
end

Instance Attribute Details

#left_expressionObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



19
20
21
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 19

def left_expression
  @left_expression
end

#right_expressionObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



25
26
27
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 25

def right_expression
  @right_expression
end

Instance Method Details

#==(other) ⇒ Boolean?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)

Since:

  • 1.0.0



127
128
129
130
131
132
133
134
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 127

def ==(other)
  return unless other.instance_of?(self.class)

  return false if left_expression != other.left_expression
  return false if right_expression != other.right_expression

  true
end

#and?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 1.0.0



119
120
121
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 119

def and?
  true
end

#each_evaluated_step(&block) ⇒ ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



93
94
95
96
97
98
99
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 93

def each_evaluated_step(&block)
  left_expression.each_evaluated_step(&block)

  right_expression.each_evaluated_step(&block) if left_expression.success?

  self
end

#each_step(&block) ⇒ ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
85
86
87
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 82

def each_step(&block)
  left_expression.each_step(&block)
  right_expression.each_step(&block)

  self
end

#error?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 1.0.0



71
72
73
74
75
76
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 71

def error?
  return false if left_expression.failure?
  return true if left_expression.error?

  right_expression.error?
end

#failure?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 1.0.0



61
62
63
64
65
66
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 61

def failure?
  return true if left_expression.failure?
  return false if left_expression.error?

  right_expression.failure?
end

#inspectString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

Since:

  • 1.0.0



112
113
114
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 112

def inspect
  "#{left_expression.inspect} && #{right_expression.inspect}"
end

#organizerConvenientService::Service

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 1.0.0



47
48
49
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 47

def organizer
  left_expression.organizer
end

#resultConvenientService::Service::Plugins::HasJSendResult::Entities::Result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 40

def result
  left_expression.success? ? right_expression.result : left_expression.result
end

#success?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 1.0.0



54
55
56
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 54

def success?
  left_expression.success? && right_expression.success?
end

#to_argumentsConvenientService::Support::Arguments

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 1.0.0



139
140
141
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 139

def to_arguments
  Support::Arguments.new(left_expression, right_expression)
end

#with_organizer(organizer) ⇒ ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Not

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



105
106
107
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb', line 105

def with_organizer(organizer)
  copy(overrides: {args: {0 => left_expression.with_organizer(organizer), 1 => right_expression.with_organizer(organizer)}})
end