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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Methods included from ConvenientService::Support::Copyable

#copy

Methods included from ConvenientService::Support::Concern

included

Constructor Details

#initialize(step) ⇒ void



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

def initialize(step)
  @step = step
end

Instance Attribute Details

#stepObject (readonly)

Returns the value of attribute step.



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

def step
  @step
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean)


113
114
115
116
117
118
119
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 113

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

  return false if step != other.step

  true
end

#each_evaluated_step(&block) {|step| ... } ⇒ ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Scalar



79
80
81
82
83
84
85
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 79

def each_evaluated_step(&block)
  result

  yield(step)

  self
end

#each_step(&block) {|step| ... } ⇒ ConvenientService::Service::Plugins::CanHaveConnectedSteps::Entities::Expressions::Scalar



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

def each_step(&block)
  yield(step)

  self
end

#error?Boolean

Returns:

  • (Boolean)


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

def error?
  result.status.unsafe_error?
end

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  result.status.unsafe_failure?
end

#inspectString

Returns:

  • (String)


98
99
100
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 98

def inspect
  "steps[#{step.index}]"
end

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



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

def result
  step.result
end

#scalar?Boolean

Returns:

  • (Boolean)


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

def scalar?
  true
end

#success?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 37

def success?
  result.status.unsafe_success?
end

#to_argumentsConvenientService::Support::Arguments



124
125
126
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 124

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

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



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

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