Class: Convertkit::Connection
- Inherits:
-
Object
- Object
- Convertkit::Connection
- Defined in:
- lib/convertkit/connection.rb
Instance Attribute Summary collapse
-
#http_connection ⇒ Object
readonly
Returns the value of attribute http_connection.
Instance Method Summary collapse
- #content_type ⇒ Object
- #delete(*args, &blk) ⇒ Object
- #get(*args, &blk) ⇒ Object
-
#initialize(api_key: nil, api_secret: nil) ⇒ Connection
constructor
A new instance of Connection.
- #post(*args, &blk) ⇒ Object
- #put(*args, &blk) ⇒ Object
Constructor Details
#initialize(api_key: nil, api_secret: nil) ⇒ Connection
Returns a new instance of Connection.
10 11 12 |
# File 'lib/convertkit/connection.rb', line 10 def initialize(api_key: nil, api_secret: nil) @http_connection = faraday_connection(api_key, api_secret) end |
Instance Attribute Details
#http_connection ⇒ Object (readonly)
Returns the value of attribute http_connection.
8 9 10 |
# File 'lib/convertkit/connection.rb', line 8 def http_connection @http_connection end |
Instance Method Details
#content_type ⇒ Object
14 15 16 |
# File 'lib/convertkit/connection.rb', line 14 def content_type "application/vnd.api+json" end |
#delete(*args, &blk) ⇒ Object
30 31 32 |
# File 'lib/convertkit/connection.rb', line 30 def delete(*args, &blk) request(:delete, *args, &blk) end |
#get(*args, &blk) ⇒ Object
18 19 20 |
# File 'lib/convertkit/connection.rb', line 18 def get(*args, &blk) request(:get, *args, &blk) end |
#post(*args, &blk) ⇒ Object
22 23 24 |
# File 'lib/convertkit/connection.rb', line 22 def post(*args, &blk) request(:post, *args, &blk) end |
#put(*args, &blk) ⇒ Object
26 27 28 |
# File 'lib/convertkit/connection.rb', line 26 def put(*args, &blk) request(:put, *args, &blk) end |