Skip to content

Commit f818391

Browse files
fix: converter should transform stringio into string where applicable (#228)
1 parent 8950333 commit f818391

File tree

5 files changed

+4
-1
lines changed

5 files changed

+4
-1
lines changed

lib/orb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
require_relative "orb/internal/util"
4040
require_relative "orb/internal/type/converter"
4141
require_relative "orb/internal/type/unknown"
42-
require_relative "orb/internal/type/boolean_model"
42+
require_relative "orb/internal/type/boolean"
4343
require_relative "orb/internal/type/enum"
4444
require_relative "orb/internal/type/union"
4545
require_relative "orb/internal/type/array_of"

lib/orb/internal/type/converter.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ def coerce(
168168
in String | Symbol | Numeric
169169
exactness[value.is_a?(Numeric) ? :maybe : :yes] += 1
170170
return value.to_s
171+
in StringIO
172+
exactness[:yes] += 1
173+
return value.string
171174
else
172175
if strictness == :strong
173176
message = "no implicit conversion of #{value.class} into #{target.inspect}"
File renamed without changes.

0 commit comments

Comments
 (0)