Class: YubiOATH::List
- Inherits:
-
Object
- Object
- YubiOATH::List
- Defined in:
- lib/yubioath/list.rb
Defined Under Namespace
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(card) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(card) ⇒ List
Returns a new instance of List.
7 8 9 |
# File 'lib/yubioath/list.rb', line 7 def initialize(card) @card = card end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yubioath/list.rb', line 11 def call request = Request.new bytes = @card.transmit(request.to_binary_s) response = Response.read(bytes) response[:codes].map do |code| [code.name, { type: TYPES.key(code.oath_type), algorithm: ALGORITHMS.key(code.algorithm), }] end.to_h end |