Class: OpsWalrus::PublicKey

Inherits:
Object
  • Object
show all
Defined in:
lib/opswalrus/hosts_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(id_name, public_key) ⇒ PublicKey

yaml_tag nil



198
199
200
201
# File 'lib/opswalrus/hosts_file.rb', line 198

def initialize(id_name, public_key)
  @id = id_name
  @public_key = public_key
end

Instance Method Details

#encode_with(coder) ⇒ Object



212
213
214
215
216
217
218
# File 'lib/opswalrus/hosts_file.rb', line 212

def encode_with(coder)
  # per https://rubydoc.info/stdlib/psych/3.0.0/Psych/Coder#scalar-instance_method
  coder.represent_scalar(nil, @public_key)

  # coder.scalar = @public_key
  # coder['public_key'] = @public_key
end

#init_with(coder) ⇒ Object

deserialise from yaml



221
222
223
224
# File 'lib/opswalrus/hosts_file.rb', line 221

def init_with(coder)
  @public_key = coder.scalar
  # @public_key = coder['public_key']
end

#keyObject



203
204
205
# File 'lib/opswalrus/hosts_file.rb', line 203

def key
  @public_key
end