Class: ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Not

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#and?, #empty?, #group?, #or?, #scalar?, #steps

Methods included from ConvenientService::Support::Copyable

#copy

Methods included from ConvenientService::Support::AbstractMethod

abstract_method

Constructor Details

#initialize(expression) ⇒ void



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

def initialize(expression)
  @expression = expression
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



14
15
16
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 14

def expression
  @expression
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


98
99
100
101
102
103
104
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 98

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

  return false if expression != other.expression

  true
end

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



66
67
68
69
70
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 66

def each_evaluated_step(&block)
  expression.each_evaluated_step(&block)

  self
end

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



56
57
58
59
60
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 56

def each_step(&block)
  expression.each_step(&block)

  self
end

#error?Boolean

Returns:

  • (Boolean)


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

def error?
  expression.error?
end

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  expression.success?
end

#inspectString

Returns:

  • (String)


83
84
85
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 83

def inspect
  "!#{expression.inspect}"
end

#not?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 90

def not?
  true
end

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



27
28
29
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 27

def result
  expression.result.negated_result
end

#success?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 34

def success?
  expression.failure?
end

#to_argumentsConvenientService::Support::Arguments



109
110
111
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 109

def to_arguments
  Support::Arguments.new(expression)
end

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



76
77
78
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/not.rb', line 76

def with_organizer(organizer)
  copy(overrides: {args: {0 => expression.with_organizer(organizer)}})
end