Module: RubyXL::CellConvenienceMethods

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

Instance Method Summary collapse

Instance Method Details

#change_border(direction, weight) ⇒ Object



549
550
551
552
# File 'lib/rubyXL/convenience_methods.rb', line 549

def change_border(direction, weight)
  validate_worksheet
  self.style_index = workbook.modify_border(self.style_index, direction, weight)
end

#change_horizontal_alignment(alignment = 'center') ⇒ Object



534
535
536
537
# File 'lib/rubyXL/convenience_methods.rb', line 534

def change_horizontal_alignment(alignment = 'center')
  validate_worksheet
  self.style_index = workbook.modify_alignment(self.style_index) { |a| a.horizontal = alignment }
end

#change_text_wrap(wrap = false) ⇒ Object



544
545
546
547
# File 'lib/rubyXL/convenience_methods.rb', line 544

def change_text_wrap(wrap = false)
  validate_worksheet
  self.style_index = workbook.modify_alignment(self.style_index) { |a| a.wrap_text = wrap }
end

#change_vertical_alignment(alignment = 'center') ⇒ Object



539
540
541
542
# File 'lib/rubyXL/convenience_methods.rb', line 539

def change_vertical_alignment(alignment = 'center')
  validate_worksheet
  self.style_index = workbook.modify_alignment(self.style_index) { |a| a.vertical = alignment }
end

#fill_colorObject



589
590
591
592
# File 'lib/rubyXL/convenience_methods.rb', line 589

def fill_color()
  validate_worksheet
  return workbook.get_fill_color(get_cell_xf)
end

#font_colorObject



584
585
586
587
# File 'lib/rubyXL/convenience_methods.rb', line 584

def font_color()
  validate_worksheet
  get_cell_font.get_rgb_color || '000000'
end

#font_nameObject



574
575
576
577
# File 'lib/rubyXL/convenience_methods.rb', line 574

def font_name()
  validate_worksheet
  get_cell_font.get_name
end

#font_sizeObject



579
580
581
582
# File 'lib/rubyXL/convenience_methods.rb', line 579

def font_size()
  validate_worksheet
  get_cell_font.get_size
end

#get_border(direction) ⇒ Object



529
530
531
532
# File 'lib/rubyXL/convenience_methods.rb', line 529

def get_border(direction)
  validate_worksheet
  get_cell_border.get_edge_style(direction)
end

#horizontal_alignmentObject



594
595
596
597
598
599
# File 'lib/rubyXL/convenience_methods.rb', line 594

def horizontal_alignment()
  validate_worksheet
  xf_obj = get_cell_xf
  return nil if xf_obj.alignment.nil?
  xf_obj.alignment.horizontal
end

#is_boldedObject



559
560
561
562
# File 'lib/rubyXL/convenience_methods.rb', line 559

def is_bolded()
  validate_worksheet
  get_cell_font.is_bold
end

#is_italicizedObject



554
555
556
557
# File 'lib/rubyXL/convenience_methods.rb', line 554

def is_italicized()
  validate_worksheet
  get_cell_font.is_italic
end

#is_struckthroughObject



569
570
571
572
# File 'lib/rubyXL/convenience_methods.rb', line 569

def is_struckthrough()
  validate_worksheet
  get_cell_font.is_strikethrough
end

#is_underlinedObject



564
565
566
567
# File 'lib/rubyXL/convenience_methods.rb', line 564

def is_underlined()
  validate_worksheet
  get_cell_font.is_underlined
end

#text_wrapObject



608
609
610
611
612
613
# File 'lib/rubyXL/convenience_methods.rb', line 608

def text_wrap()
  validate_worksheet
  xf_obj = get_cell_xf
  return nil if xf_obj.alignment.nil?
  xf_obj.alignment.wrap_text
end

#vertical_alignmentObject



601
602
603
604
605
606
# File 'lib/rubyXL/convenience_methods.rb', line 601

def vertical_alignment()
  validate_worksheet
  xf_obj = get_cell_xf
  return nil if xf_obj.alignment.nil?
  xf_obj.alignment.vertical
end