Sha256: 7a383f4b45a03271f3e01bdceceea68e15ab3458b0a64a091644f0e7a0532661

Contents?: true

Size: 468 Bytes

Versions: 13

Compression:

Stored size: 468 Bytes

Contents

# frozen_string_literal: true

require 'cased/query'

module Cased
  class Policy
    attr_reader :api_key
    attr_reader :client

    def initialize(api_key:)
      @api_key = api_key
      @client = Cased::Clients.create(api_key: @api_key)
    end

    def events(phrase: nil, variables: {})
      Query.new(@client, phrase: phrase, variables: variables)
    end

    def event(id)
      response = @client.get("events/#{id}")
      response.body
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cased-ruby-0.5.2 lib/cased/policy.rb
cased-ruby-0.5.1 lib/cased/policy.rb
cased-ruby-0.5.0 lib/cased/policy.rb
cased-ruby-0.4.8 lib/cased/policy.rb
cased-ruby-0.4.7 lib/cased/policy.rb
cased-ruby-0.4.6 lib/cased/policy.rb
cased-ruby-0.4.5 lib/cased/policy.rb
cased-ruby-0.4.4 lib/cased/policy.rb
cased-ruby-0.4.3 lib/cased/policy.rb
cased-ruby-0.4.2 lib/cased/policy.rb
cased-ruby-0.4.1 lib/cased/policy.rb
cased-ruby-0.4.0 lib/cased/policy.rb
cased-ruby-0.3.3 lib/cased/policy.rb