Class: ConvertKit::Client
- Inherits:
-
Object
- Object
- ConvertKit::Client
- Includes:
- HTTParty
- Defined in:
- lib/convertkit/form.rb,
lib/convertkit/client.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #courses ⇒ Object
- #form(id) ⇒ Object
- #forms ⇒ Object
-
#initialize(key, uri = "https://api.convertkit.com") ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(key, uri = "https://api.convertkit.com") ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 |
# File 'lib/convertkit/client.rb', line 10 def initialize(key, uri="https://api.convertkit.com") @key = key @uri = uri @version = 2 end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/convertkit/client.rb', line 8 def key @key end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/convertkit/client.rb', line 8 def uri @uri end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/convertkit/client.rb', line 8 def version @version end |
Instance Method Details
#courses ⇒ Object
23 24 25 |
# File 'lib/convertkit/client.rb', line 23 def courses() end |
#form(id) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/convertkit/client.rb', line 16 def form(id) form = ConvertKit::Form.new(id) form.client = self form end |
#forms ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/convertkit/form.rb', line 30 def forms() raw = get_request("/forms") forms = [] raw.each do |raw_form| form = ConvertKit::Form.new(raw_form["id"]) form.load(raw_form, self) forms << form end forms end |