Module: RubyXL::FontConvenienceMethods
- Included in:
- Font
- Defined in:
- lib/rubyXL/convenience_methods.rb
Instance Method Summary collapse
- #get_name ⇒ Object
- #get_rgb_color ⇒ Object
- #get_size ⇒ Object
- #is_bold ⇒ Object
-
#is_italic ⇒ Object
Funny enough, but presence of <i> without value (equivalent to ‘val == nul`) means “italic = true”! Same is true for bold, strikethrough, etc.
- #is_strikethrough ⇒ Object
- #is_underlined ⇒ Object
- #set_bold(val) ⇒ Object
- #set_italic(val) ⇒ Object
- #set_name(val) ⇒ Object
- #set_rgb_color(font_color) ⇒ Object
- #set_size(val) ⇒ Object
- #set_strikethrough(val) ⇒ Object
- #set_underline(val) ⇒ Object
Instance Method Details
#get_name ⇒ Object
1081 1082 1083 |
# File 'lib/rubyXL/convenience_methods.rb', line 1081 def get_name name && name.val end |
#get_rgb_color ⇒ Object
1089 1090 1091 |
# File 'lib/rubyXL/convenience_methods.rb', line 1089 def get_rgb_color color && color.rgb end |
#get_size ⇒ Object
1085 1086 1087 |
# File 'lib/rubyXL/convenience_methods.rb', line 1085 def get_size sz && sz.val end |
#is_bold ⇒ Object
1069 1070 1071 |
# File 'lib/rubyXL/convenience_methods.rb', line 1069 def is_bold b && (b.val != false) end |
#is_italic ⇒ Object
Funny enough, but presence of <i> without value (equivalent to ‘val == nul`) means “italic = true”! Same is true for bold, strikethrough, etc
1065 1066 1067 |
# File 'lib/rubyXL/convenience_methods.rb', line 1065 def is_italic i && (i.val != false) end |
#is_strikethrough ⇒ Object
1077 1078 1079 |
# File 'lib/rubyXL/convenience_methods.rb', line 1077 def is_strikethrough strike && (strike.val != false) end |
#is_underlined ⇒ Object
1073 1074 1075 |
# File 'lib/rubyXL/convenience_methods.rb', line 1073 def is_underlined u && (u.val != false) end |
#set_bold(val) ⇒ Object
1097 1098 1099 |
# File 'lib/rubyXL/convenience_methods.rb', line 1097 def set_bold(val) self.b = RubyXL::BooleanValue.new(:val => val) end |
#set_italic(val) ⇒ Object
1093 1094 1095 |
# File 'lib/rubyXL/convenience_methods.rb', line 1093 def set_italic(val) self.i = RubyXL::BooleanValue.new(:val => val) end |
#set_name(val) ⇒ Object
1109 1110 1111 |
# File 'lib/rubyXL/convenience_methods.rb', line 1109 def set_name(val) self.name = RubyXL::StringValue.new(:val => val) end |
#set_rgb_color(font_color) ⇒ Object
1117 1118 1119 |
# File 'lib/rubyXL/convenience_methods.rb', line 1117 def set_rgb_color(font_color) self.color = RubyXL::Color.new(:rgb => font_color.to_s) end |
#set_size(val) ⇒ Object
1113 1114 1115 |
# File 'lib/rubyXL/convenience_methods.rb', line 1113 def set_size(val) self.sz = RubyXL::FloatValue.new(:val => val) end |
#set_strikethrough(val) ⇒ Object
1105 1106 1107 |
# File 'lib/rubyXL/convenience_methods.rb', line 1105 def set_strikethrough(val) self.strike = RubyXL::BooleanValue.new(:val => val) end |
#set_underline(val) ⇒ Object
1101 1102 1103 |
# File 'lib/rubyXL/convenience_methods.rb', line 1101 def set_underline(val) self.u = RubyXL::BooleanValue.new(:val => val) end |