File: request_base.rb

package info (click to toggle)
ruby-u2f 0.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 727; makefile: 12
file content (21 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module U2F
  module RequestBase
    attr_accessor :version, :challenge, :app_id

    def as_json(options = {})
      {
        version: version,
        challenge: challenge,
        appId: app_id
      }
    end

    def to_json(options = {})
      ::JSON.pretty_generate(as_json, options)
    end

    def version
      'U2F_V2'
    end
  end
end