# Class: ROTP::OTP::URI

Inherits:
  Object
  - Object
  - ROTP::OTP::URI
  show all

Defined in:
  lib/rotp/otp/uri.rb

## Overview

github.com/google/google-authenticator/wiki/Key-Uri-Format

## Instance Method Summary collapse

- #initialize(otp, account_name:, counter: nil) ⇒ URI constructor

  A new instance of URI.

- #to_s ⇒ Object

## Constructor Details

### #initialize(otp, account_name:, counter: nil) ⇒ `URI`

Returns a new instance of URI.

    5
    6
    7
    8
    9

    # File 'lib/rotp/otp/uri.rb', line 5

    def initialize(otp, account_name:, counter: nil)
      @otp = otp
      @account_name = account_name
      @counter = counter
    end

## Instance Method Details

### #to_s ⇒ `Object`

    11
    12
    13

    # File 'lib/rotp/otp/uri.rb', line 11

    def to_s
      "otpauth://#{type}/#{label}?#{parameters}"
    end