Skip to content

Commit abbd446

Browse files
committed
Extract method
1 parent 66eea66 commit abbd446

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ucl/encoder.cr

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ module UCL
1515
emitter = EMITTERS[emit_type]?
1616
raise UCL::Error::EncoderError.new("Unknown emitter format: #{emit_type}") if emitter.nil?
1717

18+
String.new(build_ucl_object(object, emitter))
19+
end
20+
21+
private def self.build_ucl_object(object, emitter)
1822
ucl_object = to_ucl_object(object)
19-
String.new UCL::LibUCL.object_emit(ucl_object, emitter)
23+
UCL::LibUCL.object_emit(ucl_object, emitter)
2024
end
2125

2226
private def self.to_ucl_object(object)

0 commit comments

Comments
 (0)