Sha256: bfa3630160bd957207256c56b49c460fc91f3045451155295860149110cdb7d4

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

module Hexlet
  # FIXME add uri parser
  class Router
    def initialize(host = "http://hexlet.io")
      @host = host
    end

    def api_teacher_lessons_url
      generate("api_teacher/lessons")
    end

    def api_member_user_check_url
      generate("api_member/user/check_auth")
    end

    private

    def generate(url)
      URI("#{@host}/#{url}.json").to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hexlet-0.0.1 lib/hexlet/router.rb