Class: Writexlsx::Package::Comments
- Inherits:
-
Object
- Object
- Writexlsx::Package::Comments
show all
- Includes:
- Utility
- Defined in:
- lib/write_xlsx/package/comments.rb
Constant Summary
Constants included
from Utility
Utility::COL_MAX, Utility::ROW_MAX, Utility::SHEETNAME_MAX, Utility::STR_MAX
Instance Method Summary
collapse
Methods included from Utility
#absolute_char, delete_files, #put_deprecate_message, #substitute_cellref, #underline_attributes, #xl_cell_to_rowcol, #xl_col_to_name, #xl_range, #xl_range_formula, #xl_rowcol_to_cell, #xml_str
Constructor Details
#initialize(worksheet) ⇒ Comments
Returns a new instance of Comments.
126
127
128
129
130
131
|
# File 'lib/write_xlsx/package/comments.rb', line 126
def initialize(worksheet)
@worksheet = worksheet
@writer = Package::XMLWriterSimple.new
@author_ids = {}
= {}
end
|
Instance Method Details
#add(comment) ⇒ Object
133
134
135
136
137
138
139
140
|
# File 'lib/write_xlsx/package/comments.rb', line 133
def add()
if [.row]
[.row][.col] =
else
[.row] = {}
[.row][.col] =
end
end
|
#assemble_xml_file ⇒ Object
154
155
156
157
158
159
160
161
162
163
|
# File 'lib/write_xlsx/package/comments.rb', line 154
def assemble_xml_file
write_xml_declaration
write_authors()
()
@writer.end_tag('comments')
@writer.crlf
@writer.close
end
|
#empty? ⇒ Boolean
142
143
144
|
# File 'lib/write_xlsx/package/comments.rb', line 142
def empty?
.empty?
end
|
183
184
185
|
# File 'lib/write_xlsx/package/comments.rb', line 183
def (row)
!![row]
end
|
#set_xml_writer(filename) ⇒ Object
150
151
152
|
# File 'lib/write_xlsx/package/comments.rb', line 150
def set_xml_writer(filename)
@writer.set_xml_writer(filename)
end
|
#size ⇒ Object
146
147
148
|
# File 'lib/write_xlsx/package/comments.rb', line 146
def size
.size
end
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
# File 'lib/write_xlsx/package/comments.rb', line 165
def
if
= []
.keys.sort.each do |row|
[row].keys.sort.each do |col|
[row][col].visible ||= 1 if
[row][col].author ||=
<< [row][col]
end
end
end
|