Sha256: 25e41a67f9dc24ae909a29eeb80d7b55c93e21bf0bd74d7ad3b25ff4da1dcdf3

Contents?: true

Size: 600 Bytes

Versions: 7

Compression:

Stored size: 600 Bytes

Contents

module Emites
  class Client
    attr_reader :http

    def initialize(token)
      @http = Http.new(token)
    end

    def authenticated?
      http.get("") do |response|
        response.code == 200
      end
    rescue RequestError => e
      raise e unless e.code == 401
      false
    end

    def emitters
      Resources::Emitter.new(http)
    end

    def webhooks
      Resources::Webhook.new(http)
    end

    def nfse
      Resources::Nfse.new(http)
    end

    def takers
      Resources::Taker.new(http)
    end

    def services
      Resources::Service.new(http)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
emites-client-0.1.4 lib/emites/client.rb
emites-client-0.1.3 lib/emites/client.rb
emites-client-0.1.2 lib/emites/client.rb
emites-client-0.1.1 lib/emites/client.rb
emites-client-0.1.0 lib/emites/client.rb
emites-client-0.0.4 lib/emites/client.rb
emites-client-0.0.3 lib/emites/client.rb