Class: FirebaseDynamicLink::Client
- Inherits:
-
Object
- Object
- FirebaseDynamicLink::Client
- Defined in:
- lib/firebase_dynamic_link/client.rb
Instance Attribute Summary collapse
-
#dynamic_link_domain ⇒ Object
Returns the value of attribute dynamic_link_domain.
Instance Method Summary collapse
Instance Attribute Details
#dynamic_link_domain ⇒ Object
Returns the value of attribute dynamic_link_domain.
3 4 5 |
# File 'lib/firebase_dynamic_link/client.rb', line 3 def dynamic_link_domain @dynamic_link_domain end |
Instance Method Details
#shorten_link(link, options = {}) ⇒ Object
on succeed
on failure
status >= 400
body {"error"=>{"code"=>400, "message"=>"Long link is not parsable: https://k4mu4.app.goo.gl?link=abcde [https://firebase.google.com/docs/dynamic-links/rest#create_a_short_link_from_parameters]", "status"=>"INVALID_ARGUMENT"}}
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/firebase_dynamic_link/client.rb', line 10 def shorten_link(link, = {}) (connection, ) suffix_option = .delete(:suffix_option) suffix_option ||= config.default.suffix.option response = connection.post(nil, { longDynamicLink: build_link(link, ), suffix: { option: suffix_option } }.to_json) if response.status.between?(200, 299) render_success(response) else raise_error(response) end rescue Faraday::ConnectionFailed => e raise FirebaseDynamicLink::ConnectionError, e. end |
#shorten_object(_json_object) ⇒ Object
31 32 33 |
# File 'lib/firebase_dynamic_link/client.rb', line 31 def shorten_object(_json_object) raise NotImplementedError end |