Class: DatagroutConduit::GuideState

Inherits:
Struct
  • Object
show all
Defined in:
lib/datagrout_conduit/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



185
186
187
# File 'lib/datagrout_conduit/types.rb', line 185

def options
  @options
end

#resultObject

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



185
186
187
# File 'lib/datagrout_conduit/types.rb', line 185

def result
  @result
end

#session_idObject

Returns the value of attribute session_id

Returns:

  • (Object)

    the current value of session_id



185
186
187
# File 'lib/datagrout_conduit/types.rb', line 185

def session_id
  @session_id
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



185
186
187
# File 'lib/datagrout_conduit/types.rb', line 185

def status
  @status
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



185
186
187
# File 'lib/datagrout_conduit/types.rb', line 185

def step
  @step
end

Class Method Details

.from_hash(hash) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
# File 'lib/datagrout_conduit/types.rb', line 186

def self.from_hash(hash)
  hash = hash.transform_keys(&:to_s)
  opts = hash["options"]&.map { |o| GuideOption.from_hash(o) }
  new(
    session_id: hash["session_id"] || hash["sessionId"],
    status: hash["status"],
    options: opts,
    result: hash["result"],
    step: hash["step"]
  )
end