Class: Attributor::Flatpack::MultilineString

Inherits:
String
  • Object
show all
Defined in:
lib/attributor/flatpack/types/multiline_string.rb

Class Method Summary collapse

Class Method Details

.exampleObject



15
16
17
# File 'lib/attributor/flatpack/types/multiline_string.rb', line 15

def self.example(*)
  '-----BEGIN EC PRIVATE KEY-----\\nMIHcAgEBBEI\\n3abcdefghijklmnop==\\n-----END EC PRIVATE KEY-----'
end

.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **options) ⇒ Object



9
10
11
12
13
# File 'lib/attributor/flatpack/types/multiline_string.rb', line 9

def self.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **options)
  value.gsub('\\n', "\n")
rescue StandardError
  super
end