From: "Iwan B." Date: 2012-08-08T21:05:09+09:00 Subject: Re: Initializer with self This is the 'real' case (used for .xlsx files generation, via axlsx gem): p = Axlsx::Package.new wb = p.workbook wb.styles.add_style sz: 16, b: true, alignment: { horizontal: :center } wb.add_worksheet(:name => "Basic Worksheet") do |sheet| ... I don't need the package object 'p', except for get a workbook. But i want to create a custom worksheet class, so i can define my predefined styles: Inside initialise method: @my_styles = {} @my_styles[:heading] = styles.add_style sz: 16, b: true, alignment: { horizontal: :center } def apply_style(name) @my_styles[name.to_sym] end Remark that 'styles' is a workbook method. Finally: wb = MyWorkbook.new ... sheet["B1"].style = wb.apply_style :boo Thank you! -- Posted via http://www.ruby-forum.com/.