Class: ConvertKit::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/convertkit/form.rb,
lib/convertkit/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



8
9
10
# File 'lib/convertkit/client.rb', line 8

def key
  @key
end

#uriObject (readonly)

Returns the value of attribute uri.



8
9
10
# File 'lib/convertkit/client.rb', line 8

def uri
  @uri
end

#versionObject (readonly)

Returns the value of attribute version.



8
9
10
# File 'lib/convertkit/client.rb', line 8

def version
  @version
end

Instance Method Details

#coursesObject



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

#formsObject



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