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)


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

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



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

def each_evaluated_step(&block)
  result

  yield(step)

  self
end

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



77
78
79
80
81
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 77

def each_step(&block)
  yield(step)

  self
end

#error?Boolean

Returns:

  • (Boolean)


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

def error?
  result.status.unsafe_error?
end

#failure?Boolean

Returns:

  • (Boolean)


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

def failure?
  result.status.unsafe_failure?
end

#inspectString

Returns:

  • (String)


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

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

#organizerConvenientService::Service



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

def organizer
  step.organizer
end

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



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

def result
  step.result
end

#scalar?Boolean

Returns:

  • (Boolean)


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

def scalar?
  true
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  result.status.unsafe_success?
end

#to_argumentsConvenientService::Support::Arguments



136
137
138
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/scalar.rb', line 136

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

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



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

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