Class: CQR::OTP::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/cqr/otp/builder.rb

Constant Summary collapse

VALID_TYPES =
[ "hotp", "totp" ].freeze
VALID_DIGITS =
[ 6, 8, nil ].freeze
VALID_PERIOD =
[ 30, 60, nil ].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#counterObject

Returns the value of attribute counter.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def counter
  @counter
end

#digitsObject

Returns the value of attribute digits.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def digits
  @digits
end

#issuerObject

Returns the value of attribute issuer.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def issuer
  @issuer
end

#labelObject

Returns the value of attribute label.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def label
  @label
end

#periodObject

Returns the value of attribute period.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def period
  @period
end

#secretObject

Returns the value of attribute secret.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def secret
  @secret
end

#typeObject

Returns the value of attribute type.



10
11
12
# File 'lib/cqr/otp/builder.rb', line 10

def type
  @type
end

Instance Method Details

#to_qrObject



12
13
14
# File 'lib/cqr/otp/builder.rb', line 12

def to_qr
  QRFormatter.new(url)
end

#to_sObject



16
17
18
# File 'lib/cqr/otp/builder.rb', line 16

def to_s
  url
end