lib/goldendocx/documents/body.rb in goldendocx-0.2.3 vs lib/goldendocx/documents/body.rb in goldendocx-0.3.0
- old
+ new
@@ -47,11 +47,11 @@
yield(xml) if block_given?
end
end
def create_text(text, options = {})
- text = build_text(text: text, **options.slice(:align, :color, :bold))
+ text = build_text(text:, **options.slice(:align, :color, :bold))
components << text
text
end
@@ -64,18 +64,18 @@
table
end
def create_image(relationship_id, options)
- image = build_image(relationship_id: relationship_id, width: options[:width], height: options[:height])
+ image = build_image(relationship_id:, width: options[:width], height: options[:height])
components << image
image
end
def create_embed_image(relationship_id, options)
- Goldendocx::Components::Image.new(relationship_id: relationship_id, width: options[:width], height: options[:height])
+ Goldendocx::Components::Image.new(relationship_id:, width: options[:width], height: options[:height])
end
def ensure_chart_type(chart_type)
chart_class = "::Goldendocx::Components::#{chart_type.capitalize}Chart"
raise Goldendocx::Charts::InvalidChartType unless Kernel.const_defined?(chart_class)