Skip to content

Commit

Permalink
Extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed May 2, 2024
1 parent 66eea66 commit abbd446
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ucl/encoder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ module UCL
emitter = EMITTERS[emit_type]?
raise UCL::Error::EncoderError.new("Unknown emitter format: #{emit_type}") if emitter.nil?

String.new(build_ucl_object(object, emitter))
end

private def self.build_ucl_object(object, emitter)
ucl_object = to_ucl_object(object)
String.new UCL::LibUCL.object_emit(ucl_object, emitter)
UCL::LibUCL.object_emit(ucl_object, emitter)
end

private def self.to_ucl_object(object)
Expand Down

0 comments on commit abbd446

Please sign in to comment.