Class: Micropub::Endpoint::Client
- Inherits:
-
Object
- Object
- Micropub::Endpoint::Client
- Defined in:
- lib/micropub/endpoint/client.rb
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(url) ⇒ Client
constructor
A new instance of Client.
- #response ⇒ Object
Constructor Details
#initialize(url) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 10 11 12 |
# File 'lib/micropub/endpoint/client.rb', line 4 def initialize(url) raise ArgumentError, "url must be a String (given #{url.class.name})" unless url.is_a?(String) @uri = Addressable::URI.parse(url) raise ArgumentError, 'url must be an absolute URI (e.g. https://example.com)' unless @uri.absolute? rescue Addressable::URI::InvalidURIError => error raise InvalidURIError, error end |