Skip to content

Commit

Permalink
Add method to fetch CK forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Palleas committed Dec 1, 2016
1 parent 1f558dc commit b52d1bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in convertkit-ruby.gemspec
gemspec

gem 'dotenv', '~> 2.1', '>= 2.1.1'
8 changes: 8 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

require "bundler/setup"
require "convertkit"
require "dotenv"

Dotenv.load(".env.local")

Convertkit.configure do |config|
config.api_secret = ENV["API_SECRET"]
config.api_key = ENV["API_KEY"]
end

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
2 changes: 2 additions & 0 deletions lib/convertkit/client.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "convertkit/client/sequences"
require "convertkit/client/subscribers"
require "convertkit/client/tags"
require "convertkit/client/forms"
require "faraday"
require "faraday_middleware"
require "json"
Expand All @@ -10,6 +11,7 @@ class Client
include Subscribers
include Sequences
include Tags
include Forms

attr_accessor :api_secret, :api_key

Expand Down
9 changes: 9 additions & 0 deletions lib/convertkit/client/forms.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Convertkit
class Client
module Forms
def forms
connection.get("forms")
end
end
end
end

0 comments on commit b52d1bc

Please sign in to comment.