You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: xfolio.rb
    path of file: ./repos/danbooru/app/logical/source/url
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class Source::URL::Xfolio < Source::URL
  attr_reader :username, :work_id, :image_id

  def self.match?(url)
    url.domain == "xfolio.jp"
  end

  def parse
    case [subdomain, domain, *path_segments]

    # https://xfolio.jp/fullscale_image?image_id=1128032&work_id=237599
    in _, "xfolio.jp", "fullscale_image" if params["image_id"].present? && params["work_id"].present?
      @work_id = params["work_id"]
      @image_id = params["image_id"]

    # https://xfolio.jp/user_asset.php?id=1128032&work_id=237599&work_image_id=1128032&type=work_image
    in _, "xfolio.jp", "user_asset.php" if params["work_image_id"].present? && params["work_id"].present?
      @work_id = params["work_id"]
      @image_id = params["work_image_id"]

    # https://xfolio.jp/en/portfolio/ben1shoga/works/237599
    # https://xfolio.jp/portfolio/ben1shoga/works/237599
    in _, "xfolio.jp", *, "portfolio", username, "works", work_id
      @username = username
      @work_id = work_id

    # https://xfolio.jp/en/portfolio/ben1shoga
    # https://xfolio.jp/en/portfolio/ben1shoga/works
    in _, "xfolio.jp", _, "portfolio", username, *rest
      @username = userna
    
  def parse
    case [subdomain, domain, *path_segments]

    # https://xfolio.jp/fullscale_image?image_id=1128032&work_id=237599
    in _, "xfolio.jp", "fullscale_image" if params["image_id"].present? && params["work_id"].present?
      @work_id = params["work_id"]
      @image_id = params["image_id"]

    # https://xfolio.jp/user_asset.php?id=1128032&work_id=237599&work_image_id=1128032&type=work_image
    in _, "xfolio.jp", "user_asset.php" if params["work_image_id"].present? && params["work_id"].present?
      @work_id = params["work_id"]
      @image_id = params["work_image_id"]

    # https://xfolio.jp/en/portfolio/ben1shoga/works/237599
    # https://xfolio.jp/portfolio/ben1shoga/works/237599
    in _, "xfolio.jp", *, "portfolio", username, "works", work_id
      @username = username
      @work_id = work_id

    # https://xfolio.jp/en/portfolio/ben1shoga
    # https://xfolio.jp/en/portfolio/ben1shoga/works
    in _, "xfolio.jp", _, "portfolio", username, *rest
      @username = username

    # https://xfolio.jp/portfolio/ben1shoga
    # https://xfolio.jp/portfolio/ben1shoga/works
    in _, "xfolio.jp", "portfolio", username, *rest
      @username = username

    else
      nil
    end
  end