Class: Osheet::XmlssWriter::Base
- Inherits:
-
Object
- Object
- Osheet::XmlssWriter::Base
- Defined in:
- lib/osheet/xmlss_writer/base.rb
Instance Attribute Summary collapse
-
#used_xstyles ⇒ Object
readonly
Returns the value of attribute used_xstyles.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
- #oworkbook=(value) ⇒ Object
- #to_data(xmlss_output_opts = {}) ⇒ Object
- #to_file(file_path, xmlss_output_opts = {}) ⇒ Object
- #xworkbook(xmlss_output_opts = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#used_xstyles ⇒ Object (readonly)
Returns the value of attribute used_xstyles.
12 13 14 |
# File 'lib/osheet/xmlss_writer/base.rb', line 12 def used_xstyles @used_xstyles end |
Instance Method Details
#oworkbook=(value) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/osheet/xmlss_writer/base.rb', line 34 def oworkbook=(value) unless value.kind_of?(::Osheet::Workbook) raise ArgumentError, "'#{value.inspect}' is not an Osheet::Workbook" end @oworkbook = value end |
#to_data(xmlss_output_opts = {}) ⇒ Object
23 24 25 |
# File 'lib/osheet/xmlss_writer/base.rb', line 23 def to_data(xmlss_output_opts={}) self.xworkbook(xmlss_output_opts).to_s end |
#to_file(file_path, xmlss_output_opts = {}) ⇒ Object
27 28 29 |
# File 'lib/osheet/xmlss_writer/base.rb', line 27 def to_file(file_path, xmlss_output_opts={}) self.xworkbook(xmlss_output_opts).to_file(file_path) end |
#xworkbook(xmlss_output_opts = {}) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/osheet/xmlss_writer/base.rb', line 41 def xworkbook(xmlss_output_opts={}) @used_xstyles = [] ::Xmlss::Workbook.new(:output => xmlss_output_opts).tap do |xwkbk| @oworkbook.worksheets.each { |sheet| worksheet(xwkbk, sheet) } end end |