lib/write_xlsx/utility.rb in write_xlsx-1.10.0 vs lib/write_xlsx/utility.rb in write_xlsx-1.10.1
- old
+ new
@@ -681,31 +681,31 @@
pattern
end
def line_fill_properties(params)
- return { :_defined => 0 } unless params
+ return { _defined: 0 } unless params
ret = params.dup
ret[:dash_type] = yield if block_given? && ret[:dash_type]
ret[:_defined] = 1
ret
end
def dash_types
{
- :solid => 'solid',
- :round_dot => 'sysDot',
- :square_dot => 'sysDash',
- :dash => 'dash',
- :dash_dot => 'dashDot',
- :long_dash => 'lgDash',
- :long_dash_dot => 'lgDashDot',
- :long_dash_dot_dot => 'lgDashDotDot',
- :dot => 'dot',
- :system_dash_dot => 'sysDashDot',
- :system_dash_dot_dot => 'sysDashDotDot'
+ solid: 'solid',
+ round_dot: 'sysDot',
+ square_dot: 'sysDash',
+ dash: 'dash',
+ dash_dot: 'dashDot',
+ long_dash: 'lgDash',
+ long_dash_dot: 'lgDashDot',
+ long_dash_dot_dot: 'lgDashDotDot',
+ dot: 'dot',
+ system_dash_dot: 'sysDashDot',
+ system_dash_dot_dot: 'sysDashDotDot'
}
end
def value_or_raise(hash, key, msg)
raise "Unknown #{msg} '#{key}'" if hash[key.to_sym].nil?
@@ -764,20 +764,20 @@
font
end
def params_to_font(params)
{
- :_name => params[:name],
- :_color => params[:color],
- :_size => params[:size],
- :_bold => params[:bold],
- :_italic => params[:italic],
- :_underline => params[:underline],
- :_pitch_family => params[:pitch_family],
- :_charset => params[:charset],
- :_baseline => params[:baseline] || 0,
- :_rotation => params[:rotation]
+ _name: params[:name],
+ _color: params[:color],
+ _size: params[:size],
+ _bold: params[:bold],
+ _italic: params[:italic],
+ _underline: params[:underline],
+ _pitch_family: params[:pitch_family],
+ _charset: params[:charset],
+ _baseline: params[:baseline] || 0,
+ _rotation: params[:rotation]
}
end
#
# Write the <c:txPr> element.
@@ -860,10 +860,10 @@
latin_attributes = get_font_latin_attributes(font)
has_color = ptrue?(font) && ptrue?(font[:_color])
if !latin_attributes.empty? || has_color
@writer.tag_elements(tag, style_attributes) do
- write_a_solid_fill(:color => font[:_color]) if has_color
+ write_a_solid_fill(color: font[:_color]) if has_color
write_a_latin(latin_attributes) unless latin_attributes.empty?
end
else
@writer.empty_tag(tag, style_attributes)
end