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?, #complex_if?, #else?, #empty?, #group?, #if?, #not?, #or?, #steps

Methods included from ConvenientService::Support::Copyable

#copy

Methods included from ConvenientService::Support::AbstractMethod

abstract_method

Constructor Details

#initialize(step) ⇒ void



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

def initialize(step)
  @step = step
end

Instance Attribute Details

#stepObject (readonly)

Returns the value of attribute step.



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

def step
  @step
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


118
119
120
121
122
123
124
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 118

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



84
85
86
87
88
89
90
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 84

def each_evaluated_step(&block)
  result

  yield(step)

  self
end

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



70
71
72
73
74
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 70

def each_step(&block)
  yield(step)

  self
end

#error?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 62

def error?
  result.status.unsafe_error?
end

#failure?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 52

def failure?
  result.status.unsafe_failure?
end

#inspectString

Returns:

  • (String)


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

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

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



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

def result
  step.result
end

#scalar?Boolean

Returns:

  • (Boolean)


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

def scalar?
  true
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  result.status.unsafe_success?
end

#to_argumentsConvenientService::Support::Arguments



129
130
131
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 129

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

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



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

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