Sha256: 08376f724dbbffbc483ad93f4f4328a3418b5b39ae08619eb87dc190c3800bf4

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

require 'form_stalker/data/base'
require 'form_stalker/data/form'
require 'form_stalker/data/form_field'
require 'form_stalker/connection'
require 'form_stalker/request'

module FormStalker
  class Client
    attr_reader :connection

    def initialize(config_or_options = nil)
      @connection = Connection.new(config_or_options || {})
    end

    def config
      connection.config
    end

    def form(form_id)
      Data::Form.tap_into request.get("form/#{form_id}.json")
    end

    def form_fields(form_id)
      Data::FormField.tap_into request.get("form/#{form_id}/field.json")
    end

    protected ######################## PROTECTED ###############################

    def request
      Request.new(connection)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
form_stalker-1.0.0 lib/form_stalker/client.rb