Sha256: 5cb6e03702cd791e4ebd1cea6fce4c88b70e3d7e44bf0732cfa7377faff25bbb

Contents?: true

Size: 724 Bytes

Versions: 13

Compression:

Stored size: 724 Bytes

Contents

module LearnWeb
  class Client
    module Environment
      class SetupList
        attr_accessor :data, :steps
        attr_reader   :response

        include AttributePopulatable

        def initialize(response)
          @response = response

          parse!
        end

        private

        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
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
learn-web-1.5.5 lib/learn_web/client/environment/setup_list.rb
learn-web-1.5.4 lib/learn_web/client/environment/setup_list.rb
learn-web-1.5.3 lib/learn_web/client/environment/setup_list.rb
learn-web-1.5.2 lib/learn_web/client/environment/setup_list.rb
learn-web-1.5.1 lib/learn_web/client/environment/setup_list.rb
learn-web-1.5.0 lib/learn_web/client/environment/setup_list.rb
learn-web-1.4.2 lib/learn_web/client/environment/setup_list.rb
learn-web-1.4.1 lib/learn_web/client/environment/setup_list.rb
learn-web-1.4.0 lib/learn_web/client/environment/setup_list.rb
learn-web-1.3.0 lib/learn_web/client/environment/setup_list.rb
learn-web-1.2.0 lib/learn_web/client/environment/setup_list.rb
learn-web-1.1.0 lib/learn_web/client/environment/setup_list.rb
learn-web-1.0.5 lib/learn_web/client/environment/setup_list.rb