Module: RubyXL::FontConvenienceMethods

Included in:
Font
Defined in:
lib/rubyXL/convenience_methods.rb

Instance Method Summary collapse

Instance Method Details

#get_nameObject



1068
1069
1070
# File 'lib/rubyXL/convenience_methods.rb', line 1068

def get_name
  name && name.val
end

#get_rgb_colorObject



1076
1077
1078
# File 'lib/rubyXL/convenience_methods.rb', line 1076

def get_rgb_color
  color && color.rgb
end

#get_sizeObject



1072
1073
1074
# File 'lib/rubyXL/convenience_methods.rb', line 1072

def get_size
  sz && sz.val
end

#is_boldObject



1056
1057
1058
# File 'lib/rubyXL/convenience_methods.rb', line 1056

def is_bold
  b && (b.val != false)
end

#is_italicObject

Funny enough, but presence of <i> without value (equivalent to ‘val == nul`) means “italic = true”! Same is true for bold, strikethrough, etc



1052
1053
1054
# File 'lib/rubyXL/convenience_methods.rb', line 1052

def is_italic
  i && (i.val != false)
end

#is_strikethroughObject



1064
1065
1066
# File 'lib/rubyXL/convenience_methods.rb', line 1064

def is_strikethrough
  strike && (strike.val != false)
end

#is_underlinedObject



1060
1061
1062
# File 'lib/rubyXL/convenience_methods.rb', line 1060

def is_underlined
  u && (u.val != false)
end

#set_bold(val) ⇒ Object



1084
1085
1086
# File 'lib/rubyXL/convenience_methods.rb', line 1084

def set_bold(val)
  self.b = RubyXL::BooleanValue.new(:val => val)
end

#set_italic(val) ⇒ Object



1080
1081
1082
# File 'lib/rubyXL/convenience_methods.rb', line 1080

def set_italic(val)
  self.i = RubyXL::BooleanValue.new(:val => val)
end

#set_name(val) ⇒ Object



1096
1097
1098
# File 'lib/rubyXL/convenience_methods.rb', line 1096

def set_name(val)
  self.name = RubyXL::StringValue.new(:val => val)
end

#set_rgb_color(font_color) ⇒ Object



1104
1105
1106
# File 'lib/rubyXL/convenience_methods.rb', line 1104

def set_rgb_color(font_color)
  self.color = RubyXL::Color.new(:rgb => font_color.to_s)
end

#set_size(val) ⇒ Object



1100
1101
1102
# File 'lib/rubyXL/convenience_methods.rb', line 1100

def set_size(val)
  self.sz = RubyXL::FloatValue.new(:val => val)
end

#set_strikethrough(val) ⇒ Object



1092
1093
1094
# File 'lib/rubyXL/convenience_methods.rb', line 1092

def set_strikethrough(val)
  self.strike = RubyXL::BooleanValue.new(:val => val)
end

#set_underline(val) ⇒ Object



1088
1089
1090
# File 'lib/rubyXL/convenience_methods.rb', line 1088

def set_underline(val)
  self.u = RubyXL::BooleanValue.new(:val => val)
end