klyn.net.URL.fromObject
method

    public static fromObject(value as Object) as URL throws MalformedURLException:

Description

Converts an object to `URL`.

Parameters

Parameter | Description
--- | ---
`value` | URL instance or textual URL.

Returns

Parsed URL.

Throws

- MalformedURLException when the value cannot be converted.

Example

    import klyn.net

    url = URL.fromObject("https://example.com")
    print(url.host)