Class: ConvertKit::Form

Inherits:
Object
  • Object
show all
Defined in:
lib/convertkit/form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Form

Returns a new instance of Form.



19
20
21
# File 'lib/convertkit/form.rb', line 19

def initialize(id)
  @id = id
end

Instance Attribute Details

#client=(value) ⇒ Object (writeonly)

Sets the attribute client

Parameters:

  • value

    the value to set the attribute client to.



5
6
7
# File 'lib/convertkit/form.rb', line 5

def client=(value)
  @client = value
end

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def created_at
  @created_at
end

#detailsObject (readonly)

Returns the value of attribute details.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def details
  @details
end

#embedObject (readonly)

Returns the value of attribute embed.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def embed
  @embed
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def name
  @name
end

#subscriber_countObject (readonly)

Returns the value of attribute subscriber_count.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def subscriber_count
  @subscriber_count
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



4
5
6
# File 'lib/convertkit/form.rb', line 4

def updated_at
  @updated_at
end

Instance Method Details

#load(data, client) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/convertkit/form.rb', line 7

def load(data, client)
  @client = client

  @id               = data["id"]
  @subscriber_count = data["subscriber_count"]
  @name             = data["name"]
  @details          = data["details"]
  @embed            = data["embed"]
  @created_at       = data["created_at"]
  @updated_at       = data["updated_at"]
end

#subscribe(opts) ⇒ Object



23
24
25
# File 'lib/convertkit/form.rb', line 23

def subscribe(opts)
  default = {email: nil, fname: nil, course_opted: true}
end