lib/axlsx/workbook/workbook.rb in axlsx-1.0.8 vs lib/axlsx/workbook/workbook.rb in axlsx-1.0.9
- old
+ new
@@ -63,19 +63,12 @@
# @see Style#add_style
# @see Style
# @return [Styles]
attr_reader :styles
- # The workbook relationships. This is managed automatically by the workbook
- # @return [Relationships]
- attr_reader :relationships
- # Instance level access to the class variable 1904
- # @return [Boolean]
- attr_accessor :date1904
-
# Indicates if the epoc date for serialization should be 1904. If false, 1900 is used.
@@date1904 = false
# Creates a new Workbook
# @option options [Boolean] date1904
@@ -87,13 +80,17 @@
@images = SimpleTypedList.new Pic
self.date1904= options[:date1904] unless options[:date1904].nil?
yield self if block_given?
end
- def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
+ # Instance level access to the class variable 1904
+ # @return [Boolean]
def date1904() @@date1904; end
+ # see @date1904
+ def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
+
# Sets the date1904 attribute to the provided boolean
# @return [Boolean]
def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
# retrieves the date1904 attribute
@@ -107,10 +104,12 @@
def add_worksheet(options={})
worksheet = Worksheet.new(self, options)
yield worksheet if block_given?
worksheet
end
-
+
+ # The workbook relationships. This is managed automatically by the workbook
+ # @return [Relationships]
def relationships
r = Relationships.new
@worksheets.each do |sheet|
r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
end