Class: ConvertKit::Form
- Inherits:
-
Object
- Object
- ConvertKit::Form
- Defined in:
- lib/convertkit/form.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#embed ⇒ Object
readonly
Returns the value of attribute embed.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#subscriber_count ⇒ Object
readonly
Returns the value of attribute subscriber_count.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(id) ⇒ Form
constructor
A new instance of Form.
- #load(data, client) ⇒ Object
- #subscribe(opts) ⇒ Object
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
5 6 7 |
# File 'lib/convertkit/form.rb', line 5 def client=(value) @client = value end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/convertkit/form.rb', line 4 def created_at @created_at end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
4 5 6 |
# File 'lib/convertkit/form.rb', line 4 def details @details end |
#embed ⇒ Object (readonly)
Returns the value of attribute embed.
4 5 6 |
# File 'lib/convertkit/form.rb', line 4 def @embed end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/convertkit/form.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/convertkit/form.rb', line 4 def name @name end |
#subscriber_count ⇒ Object (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_at ⇒ Object (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 |