Class: COSE::Key::Curve

Inherits:
Struct
  • Object
show all
Defined in:
lib/cose/key/curve.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



6
7
8
# File 'lib/cose/key/curve.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/cose/key/curve.rb', line 6

def name
  @name
end

#pkey_nameObject

Returns the value of attribute pkey_name

Returns:

  • (Object)

    the current value of pkey_name



6
7
8
# File 'lib/cose/key/curve.rb', line 6

def pkey_name
  @pkey_name
end

Class Method Details

.by_name(name) ⇒ Object



17
18
19
# File 'lib/cose/key/curve.rb', line 17

def self.by_name(name)
  @curves.values.detect { |curve| curve.name == name }
end

.by_pkey_name(pkey_name) ⇒ Object



21
22
23
# File 'lib/cose/key/curve.rb', line 21

def self.by_pkey_name(pkey_name)
  @curves.values.detect { |curve| curve.pkey_name == pkey_name }
end

.find(id) ⇒ Object



13
14
15
# File 'lib/cose/key/curve.rb', line 13

def self.find(id)
  @curves[id]
end

.register(id, name, pkey_name) ⇒ Object



9
10
11
# File 'lib/cose/key/curve.rb', line 9

def self.register(id, name, pkey_name)
  @curves[id] = new(id, name, pkey_name)
end

Instance Method Details

#valueObject



25
26
27
# File 'lib/cose/key/curve.rb', line 25

def value
  id
end