Class: FirebaseDynamicLink::Connection
- Inherits:
-
Object
- Object
- FirebaseDynamicLink::Connection
- Extended by:
- Forwardable
- Defined in:
- lib/firebase_dynamic_link/connection.rb
Overview
Responsible to do HTTP request
Instance Method Summary collapse
-
#initialize(end_point) ⇒ Connection
constructor
A new instance of Connection.
- #open_timeout ⇒ Object
- #open_timeout=(time) ⇒ Object
-
#post ⇒ Object
see Faraday::Connection#post.
- #timeout ⇒ Object
- #timeout=(time) ⇒ Object
Constructor Details
#initialize(end_point) ⇒ Connection
Returns a new instance of Connection.
12 13 14 15 16 17 18 |
# File 'lib/firebase_dynamic_link/connection.rb', line 12 def initialize(end_point) @client = Faraday::Connection.new(url: end_point, headers: { "Content-Type" => "application/json" }) client..timeout = FirebaseDynamicLink.config.timeout client..open_timeout = FirebaseDynamicLink.config.open_timeout end |
Instance Method Details
#open_timeout ⇒ Object
36 37 38 |
# File 'lib/firebase_dynamic_link/connection.rb', line 36 def open_timeout client..open_timeout end |
#open_timeout=(time) ⇒ Object
31 32 33 |
# File 'lib/firebase_dynamic_link/connection.rb', line 31 def open_timeout=(time) client..open_timeout = time end |
#post ⇒ Object
see Faraday::Connection#post
10 |
# File 'lib/firebase_dynamic_link/connection.rb', line 10 def_delegators :client, :post |
#timeout ⇒ Object
26 27 28 |
# File 'lib/firebase_dynamic_link/connection.rb', line 26 def timeout client..timeout end |
#timeout=(time) ⇒ Object
21 22 23 |
# File 'lib/firebase_dynamic_link/connection.rb', line 21 def timeout=(time) client..timeout = time end |