lib/prawn/text/box.rb in prawn-2.3.0 vs lib/prawn/text/box.rb in prawn-2.4.0

- old
+ new

@@ -105,18 +105,19 @@ # def text_box(string, options = {}) options = options.dup options[:document] = self - box = if options[:inline_format] - p = options.delete(:inline_format) - p = [] unless p.is_a?(Array) - array = text_formatter.format(string, *p) - Text::Formatted::Box.new(array, options) - else - Text::Box.new(string, options) - end + box = + if options[:inline_format] + p = options.delete(:inline_format) + p = [] unless p.is_a?(Array) + array = text_formatter.format(string, *p) + Text::Formatted::Box.new(array, options) + else + Text::Box.new(string, options) + end box.render end # @group Experimental API @@ -132,10 +133,10 @@ super([{ text: string }], options) end def render(flags = {}) leftover = super(flags) - leftover.collect { |hash| hash[:text] }.join + leftover.map { |hash| hash[:text] }.join end end end end