Class: WaitStep

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schema.rb

Overview

Waits for previous steps to pass before continuing

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
# File 'lib/schema.rb', line 2185

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    allow_dependency_failure: d["allow_dependency_failure"] ? AllowDependencyFailureUnion.from_dynamic!(d["allow_dependency_failure"]) : nil,
    branches: d["branches"] ? Branches.from_dynamic!(d["branches"]) : nil,
    continue_on_failure: d["continue_on_failure"] ? AllowDependencyFailureUnion.from_dynamic!(d["continue_on_failure"]) : nil,
    depends_on: d["depends_on"] ? DependsOn.from_dynamic!(d["depends_on"]) : nil,
    id: d["id"],
    identifier: d["identifier"],
    wait_step_if: d["if"],
    key: d["key"],
    label: d["label"],
    wait_step_name: d["name"],
    wait_step_type: d["type"],
    wait: d["wait"]
  )
end

.from_json!(json) ⇒ Object



2203
2204
2205
# File 'lib/schema.rb', line 2203

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
# File 'lib/schema.rb', line 2207

def to_dynamic
  {
    "allow_dependency_failure" => allow_dependency_failure&.to_dynamic,
    "branches" => branches&.to_dynamic,
    "continue_on_failure" => continue_on_failure&.to_dynamic,
    "depends_on" => depends_on&.to_dynamic,
    "id" => id,
    "identifier" => identifier,
    "if" => wait_step_if,
    "key" => key,
    "label" => label,
    "name" => wait_step_name,
    "type" => wait_step_type,
    "wait" => wait
  }
end

#to_json(options = nil) ⇒ Object



2224
2225
2226
# File 'lib/schema.rb', line 2224

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end