Class: StringT
Class Method Summary collapse
Instance Method Summary collapse
- #!=(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(value) ⇒ StringT
constructor
A new instance of StringT.
Methods inherited from Any
Constructor Details
#initialize(value) ⇒ StringT
Returns a new instance of StringT.
46 |
# File 'lib/types/string_t.rb', line 46 def initialize(value) = super(setup_value(value)) |
Class Method Details
.t(*values) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/types/string_t.rb', line 9 def t(*values) validated_values = ArrayT.new( values.map do |value| raise RubytTypeError.new(StringT, value.class) unless value.is_a? StringT value end ) return validated_values.t.first if validated_values.t.length == 1 validated_values end |