initialize

in src/shapes.rb [107:123]


  def initialize(event_json)
    body = event_json["body"]
    if event_json["isBase64Encoded"]
      body = Base64.decode64(body)
      puts "[DEBUG] Decoded #{body} from base64 encoded body #{event_json["body"]}"
    end
    begin
      body_json = JSON.parse(body)
      @errors = []
      @title = body_json["title"]
      @description = body_json["description"]
      @status = body_json["status"]
    rescue JSON::ParserError
      @errors = ["Request body must be valid JSON."]
    end
  end