Class: Typeform::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/typeform/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Client

Returns a new instance of Client.



12
13
14
# File 'lib/typeform/client.rb', line 12

def initialize(api_key)
  @conn = Connection.new(api_key)
end

Instance Method Details

#create_form_from_file(file) ⇒ Object



28
29
30
# File 'lib/typeform/client.rb', line 28

def create_form_from_file(file)
  create_form_from_json(JSON.parse(file.read))
end

#create_form_from_json(json) ⇒ Object



24
25
26
# File 'lib/typeform/client.rb', line 24

def create_form_from_json(json)
  @conn.post "/forms", json
end

#informationObject



16
17
18
# File 'lib/typeform/client.rb', line 16

def information
  @conn.get "/"
end

#show_form(id) ⇒ Object



20
21
22
# File 'lib/typeform/client.rb', line 20

def show_form(id)
  @conn.get "/forms/#{id}"
end