Sha256: 266f444fff9297b2898006cf501d2d75136f4b7ad76d8bc441683241b9cdfdfb

Contents?: true

Size: 310 Bytes

Versions: 2

Compression:

Stored size: 310 Bytes

Contents

# frozen_string_literal: true
require_relative 'student_list_strat'
require 'json'

class StudentListJson < StudentListStrategy

  public_class_method :new

  def string_to_list(str)
    JSON.parse(str, {symbolize_names: true})
  end

  def list_to_string(list)
    JSON.generate(list)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shanti555890-1.1.5 lib/source/strategy/student_list_json.rb
shanti555890-1.1.4 lib/source/strategy/student_list_json.rb