Class: Structured::String

Inherits:
Object
  • Object
show all
Extended by:
Type
Defined in:
lib/structured/string.rb

Class Method Summary collapse

Methods included from Type

default_value, parse, type_name

Class Method Details

.parse(yaml_value, stack:, context: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/structured/string.rb', line 5

def self.parse(yaml_value, stack:, context: nil)
  unless yaml_value.is_a?(::String)
    raise Structured::Errors::InvalidValue.new(
      stack,
      "#{stack} expects a string, but found: #{yaml_value.inspect}"
    )
  end
  yaml_value
end