Sha256: e12d814b2b078f5ba1c46a5a76e0282b8d07ea583b70290ed6ca7001096b8b68

Contents?: true

Size: 510 Bytes

Versions: 4

Compression:

Stored size: 510 Bytes

Contents

module Workarea
  module Listrak
    class EmailApi::Lists
      attr_reader :client

      def initialize(client)
        @client = client
      end

      # Get all lists in Listrak
      #
      # @return [Array<Workarea::Listrak::Models::List>] Listrak lists
      def all
        request = Net::HTTP::Get.new("/email/v1/List")
        response = client.request request
        body = JSON.parse(response.body)
        body["data"].map { |list| Listrak::Models::List.new list }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-listrak-5.0.4 app/services/workarea/listrak/email_api/lists.rb
workarea-listrak-5.0.3 app/services/workarea/listrak/email_api/lists.rb
workarea-listrak-5.0.2 app/services/workarea/listrak/email_api/lists.rb
workarea-listrak-5.0.1 app/services/workarea/listrak/email_api/lists.rb