class LearnWeb::Client::Environment::SetupList

Attributes

data[RW]
response[R]
steps[RW]

Public Class Methods

new(response) click to toggle source
# File lib/learn_web/client/environment/setup_list.rb, line 10
def initialize(response)
  @response = response

  parse!
end

Private Instance Methods

parse!() click to toggle source
# File lib/learn_web/client/environment/setup_list.rb, line 18
def parse!
  case response.status
  when 200
    self.data = Oj.load(response.body, symbol_keys: true)
    self.steps = self.data
  when 422, 500
    puts "Sorry, something went wrong. Please try again."
    exit
  else
    puts "Sorry, something went wrong. Please try again."
    exit
  end
end