Sha256: d1078149f83ef2c4730e64e3b7f49b9cb8ab7657611a51d9c987f15139226974

Contents?: true

Size: 643 Bytes

Versions: 8

Compression:

Stored size: 643 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative './config'

# Fetch the authentication/identity for the first time, subsequent calls
# to this method will return the cached authentication instance until it
# is expired (or near expiration, 5 minutes leeway) then a new
# authentication is fetched transparently
pp PriceHubble.identity
# => #<PriceHubble::Authentication access_token="...", ...>

# Check the expiration state (transparently always unexpired)
pp PriceHubble.identity.expired?
# => false

# Get the current authentication expiration date/time
pp PriceHubble.identity.expires_at
# => 2019-10-17 08:01:23 +0000

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pricehubble-1.1.0 doc/examples/authentication.rb
pricehubble-1.0.0 doc/examples/authentication.rb
pricehubble-0.4.2 doc/examples/authentication.rb
pricehubble-0.4.1 doc/examples/authentication.rb
pricehubble-0.4.0 doc/examples/authentication.rb
pricehubble-0.3.0 doc/examples/authentication.rb
pricehubble-0.2.0 doc/examples/authentication.rb
pricehubble-0.1.0 doc/examples/authentication.rb