Class: OOXML::Excel::Sheet::DataValidation
- Inherits:
-
Object
- Object
- OOXML::Excel::Sheet::DataValidation
- Defined in:
- lib/ooxml_excel/sheet.rb
Instance Attribute Summary collapse
-
#allow_blank ⇒ Object
Returns the value of attribute allow_blank.
-
#formula ⇒ Object
Returns the value of attribute formula.
-
#prompt ⇒ Object
Returns the value of attribute prompt.
-
#sqref ⇒ Object
Returns the value of attribute sqref.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#allow_blank ⇒ Object
Returns the value of attribute allow_blank.
194 195 196 |
# File 'lib/ooxml_excel/sheet.rb', line 194 def allow_blank @allow_blank end |
#formula ⇒ Object
Returns the value of attribute formula.
194 195 196 |
# File 'lib/ooxml_excel/sheet.rb', line 194 def formula @formula end |
#prompt ⇒ Object
Returns the value of attribute prompt.
194 195 196 |
# File 'lib/ooxml_excel/sheet.rb', line 194 def prompt @prompt end |
#sqref ⇒ Object
Returns the value of attribute sqref.
194 195 196 |
# File 'lib/ooxml_excel/sheet.rb', line 194 def sqref @sqref end |
#type ⇒ Object
Returns the value of attribute type.
194 195 196 |
# File 'lib/ooxml_excel/sheet.rb', line 194 def type @type end |
Class Method Details
.load_from_node(data_validation_node) ⇒ Object
213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/ooxml_excel/sheet.rb', line 213 def self.load_from_node(data_validation_node) allow_blank = data_validation_node.attribute('allowBlank').try(:value) prompt = data_validation_node.attribute('prompt').try(:value) type = data_validation_node.attribute('type').try(:value) sqref = data_validation_node.attribute('sqref').try(:value) formula = data_validation_node.at('formula1').try(:content) self.new(allow_blank: allow_blank, prompt: prompt, type: type, sqref: sqref, formula: formula) end |
Instance Method Details
#sqref_range ⇒ Object
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/ooxml_excel/sheet.rb', line 196 def sqref_range @sqref_range ||= begin # "BH5:BH271 BI5:BI271" sqref.split( ' ').map do |splitted_by_space_sqref| # ["BH5:BH271, "BI5:BI271"] if splitted_by_space_sqref.is_a?(Array) splitted_by_space_sqref.map do |sqref| split_sqref(sqref) end else # "BH5:BH271" split_sqref(splitted_by_space_sqref) end end.flatten.uniq end end |