Module: Scjson::Types::BindingDatatypeProps
- Defined in:
- lib/scjson/types.rb
Overview
The binding type in use for the SCXML document.
Constant Summary collapse
Class Method Summary collapse
-
.coerce(value, allow_nil: false) ⇒ String?
Coerce arbitrary input into a valid enumeration value.
-
.default ⇒ String
Schema-defined default enumeration value.
-
.values ⇒ Array<String>
All legal enumeration values.
Class Method Details
.coerce(value, allow_nil: false) ⇒ String?
Coerce arbitrary input into a valid enumeration value.
77 78 79 80 81 82 83 84 85 |
# File 'lib/scjson/types.rb', line 77 def coerce(value, allow_nil: false) return nil if allow_nil && value.nil? return DEFAULT if value.nil? candidate = value.to_s return candidate if VALUES.include?(candidate) raise ArgumentError, "Unsupported value '#{value}' for BindingDatatypeProps" end |
.default ⇒ String
Returns Schema-defined default enumeration value.
69 70 71 |
# File 'lib/scjson/types.rb', line 69 def default DEFAULT end |
.values ⇒ Array<String>
Returns All legal enumeration values.
64 65 66 |
# File 'lib/scjson/types.rb', line 64 def values VALUES end |