Module: RubyXL::CellConvenienceMethods
- Included in:
- Cell
- Defined in:
- lib/rubyXL/convenience_methods.rb
Instance Method Summary collapse
- #change_border(direction, weight) ⇒ Object
- #change_horizontal_alignment(alignment = 'center') ⇒ Object
- #change_text_wrap(wrap = false) ⇒ Object
- #change_vertical_alignment(alignment = 'center') ⇒ Object
- #fill_color ⇒ Object
- #font_color ⇒ Object
- #font_name ⇒ Object
- #font_size ⇒ Object
- #get_border(direction) ⇒ Object
- #horizontal_alignment ⇒ Object
- #is_bolded ⇒ Object
- #is_italicized ⇒ Object
- #is_struckthrough ⇒ Object
- #is_underlined ⇒ Object
- #text_wrap ⇒ Object
- #vertical_alignment ⇒ Object
Instance Method Details
#change_border(direction, weight) ⇒ Object
597 598 599 600 |
# File 'lib/rubyXL/convenience_methods.rb', line 597 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
582 583 584 585 |
# File 'lib/rubyXL/convenience_methods.rb', line 582 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
592 593 594 595 |
# File 'lib/rubyXL/convenience_methods.rb', line 592 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
587 588 589 590 |
# File 'lib/rubyXL/convenience_methods.rb', line 587 def change_vertical_alignment(alignment = 'center') validate_worksheet self.style_index = workbook.modify_alignment(self.style_index) { |a| a.vertical = alignment } end |
#fill_color ⇒ Object
637 638 639 640 |
# File 'lib/rubyXL/convenience_methods.rb', line 637 def fill_color() validate_worksheet return workbook.get_fill_color(get_cell_xf) end |
#font_color ⇒ Object
632 633 634 635 |
# File 'lib/rubyXL/convenience_methods.rb', line 632 def font_color() validate_worksheet get_cell_font.get_rgb_color || '000000' end |
#font_name ⇒ Object
622 623 624 625 |
# File 'lib/rubyXL/convenience_methods.rb', line 622 def font_name() validate_worksheet get_cell_font.get_name end |
#font_size ⇒ Object
627 628 629 630 |
# File 'lib/rubyXL/convenience_methods.rb', line 627 def font_size() validate_worksheet get_cell_font.get_size end |
#get_border(direction) ⇒ Object
577 578 579 580 |
# File 'lib/rubyXL/convenience_methods.rb', line 577 def get_border(direction) validate_worksheet get_cell_border.get_edge_style(direction) end |
#horizontal_alignment ⇒ Object
642 643 644 645 646 647 |
# File 'lib/rubyXL/convenience_methods.rb', line 642 def horizontal_alignment() validate_worksheet xf_obj = get_cell_xf return nil if xf_obj.alignment.nil? xf_obj.alignment.horizontal end |
#is_bolded ⇒ Object
607 608 609 610 |
# File 'lib/rubyXL/convenience_methods.rb', line 607 def is_bolded() validate_worksheet get_cell_font.is_bold end |
#is_italicized ⇒ Object
602 603 604 605 |
# File 'lib/rubyXL/convenience_methods.rb', line 602 def is_italicized() validate_worksheet get_cell_font.is_italic end |
#is_struckthrough ⇒ Object
617 618 619 620 |
# File 'lib/rubyXL/convenience_methods.rb', line 617 def is_struckthrough() validate_worksheet get_cell_font.is_strikethrough end |
#is_underlined ⇒ Object
612 613 614 615 |
# File 'lib/rubyXL/convenience_methods.rb', line 612 def is_underlined() validate_worksheet get_cell_font.is_underlined end |
#text_wrap ⇒ Object
656 657 658 659 660 661 |
# File 'lib/rubyXL/convenience_methods.rb', line 656 def text_wrap() validate_worksheet xf_obj = get_cell_xf return nil if xf_obj.alignment.nil? xf_obj.alignment.wrap_text end |
#vertical_alignment ⇒ Object
649 650 651 652 653 654 |
# File 'lib/rubyXL/convenience_methods.rb', line 649 def vertical_alignment() validate_worksheet xf_obj = get_cell_xf return nil if xf_obj.alignment.nil? xf_obj.alignment.vertical end |