Class: Blueticks::Resources::UtilsResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Blueticks::Resources::UtilsResource
- Defined in:
- lib/blueticks/resources/utils.rb
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#link_preview(url:) ⇒ Object
Fetch OpenGraph-style metadata for a URL (uses the engine’s renderer).
-
#validate_phone(phone_or_chat_id:) ⇒ Object
Validate a phone number or chat-id; returns the engine’s canonical form.
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Blueticks::BaseResource
Instance Method Details
#link_preview(url:) ⇒ Object
Fetch OpenGraph-style metadata for a URL (uses the engine’s renderer).
17 18 19 20 |
# File 'lib/blueticks/resources/utils.rb', line 17 def link_preview(url:) data = client.request("GET", "/v1/utils/link_preview", params: { "url" => url }) Types::LinkPreview.from_hash(data) end |
#validate_phone(phone_or_chat_id:) ⇒ Object
Validate a phone number or chat-id; returns the engine’s canonical form.
10 11 12 13 14 |
# File 'lib/blueticks/resources/utils.rb', line 10 def validate_phone(phone_or_chat_id:) data = client.request("POST", "/v1/utils/validate_phone", body: { "phone_or_chat_id" => phone_or_chat_id }) Types::PhoneValidation.from_hash(data) end |