Class: Universign::Signer

Inherits:
Object
  • Object
show all
Defined in:
lib/universign/signer.rb

Direct Known Subclasses

SignerInfos, TransactionSigner

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Signer

Returns a new instance of Signer.



5
6
7
8
9
10
11
# File 'lib/universign/signer.rb', line 5

def initialize(options = {})
  @params = {}

  options.each do |key, value|
    send("#{key}=", value)
  end
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/universign/signer.rb', line 3

def params
  @params
end

Class Method Details

.from_data(data) ⇒ Object



13
14
15
# File 'lib/universign/signer.rb', line 13

def self.from_data(data)
  @params = data
end

Instance Method Details

#first_nameString

This signer’s firstname

Returns:

  • (String)


20
21
22
# File 'lib/universign/signer.rb', line 20

def first_name
  @first_name || params['firstName']
end

#first_name=(data) ⇒ Object



24
25
26
27
# File 'lib/universign/signer.rb', line 24

def first_name=(data)
  @first_name        = data
  params[:firstname] = data
end

#last_nameString

This signer’s lastname

Returns:

  • (String)


32
33
34
# File 'lib/universign/signer.rb', line 32

def last_name
  @last_name || params['lastName']
end

#last_name=(data) ⇒ Object



36
37
38
39
# File 'lib/universign/signer.rb', line 36

def last_name=(data)
  @last_name        = data
  params[:lastname] = data
end