Module: FastExcel::WorkbookExt
- Includes:
- AttributeHelper
- Defined in:
- lib/fast_excel.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#is_open ⇒ Object
Returns the value of attribute is_open.
-
#tmp_file ⇒ Object
Returns the value of attribute tmp_file.
Instance Method Summary collapse
- #add_worksheet(sheetname = nil) ⇒ Object
- #bold_cell_format ⇒ Object
- #close ⇒ Object
- #initialize(struct) ⇒ Object
-
#number_format(pattern) ⇒ Object
“#,##0.00” “[$-409]m/d/yy h:mm AM/PM;@”.
- #read_string ⇒ Object
- #remove_tmp_file ⇒ Object
Methods included from AttributeHelper
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
124 125 126 |
# File 'lib/fast_excel.rb', line 124 def filename @filename end |
#is_open ⇒ Object
Returns the value of attribute is_open.
124 125 126 |
# File 'lib/fast_excel.rb', line 124 def is_open @is_open end |
#tmp_file ⇒ Object
Returns the value of attribute tmp_file.
124 125 126 |
# File 'lib/fast_excel.rb', line 124 def tmp_file @tmp_file end |
Instance Method Details
#add_worksheet(sheetname = nil) ⇒ Object
145 146 147 |
# File 'lib/fast_excel.rb', line 145 def add_worksheet(sheetname = nil) super end |
#bold_cell_format ⇒ Object
131 132 133 134 135 |
# File 'lib/fast_excel.rb', line 131 def bold_cell_format bold = add_format bold.set_bold bold end |
#close ⇒ Object
149 150 151 152 |
# File 'lib/fast_excel.rb', line 149 def close @is_open = false super end |
#initialize(struct) ⇒ Object
126 127 128 129 |
# File 'lib/fast_excel.rb', line 126 def initialize(struct) @is_open = true super(struct) end |
#number_format(pattern) ⇒ Object
“#,##0.00” “[$-409]m/d/yy h:mm AM/PM;@”
139 140 141 142 143 |
# File 'lib/fast_excel.rb', line 139 def number_format(pattern) format = add_format format.set_num_format(pattern) format end |
#read_string ⇒ Object
154 155 156 157 158 159 |
# File 'lib/fast_excel.rb', line 154 def read_string close if @is_open File.open(filename, 'rb', &:read) ensure remove_tmp_file end |
#remove_tmp_file ⇒ Object
161 162 163 |
# File 'lib/fast_excel.rb', line 161 def remove_tmp_file File.delete(filename) if tmp_file end |