Class: Smerp::Exporter::Excel::Workbook
- Inherits:
-
Object
- Object
- Smerp::Exporter::Excel::Workbook
- Defined in:
- lib/smerp/exporter/excel/workbook.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#inst ⇒ Object
readonly
Returns the value of attribute inst.
Instance Method Summary collapse
-
#initialize(wb, config) ⇒ Workbook
constructor
A new instance of Workbook.
- #method_missing(mtd, *args, &block) ⇒ Object
- #worksheet(name, *args, &block) ⇒ Object
Constructor Details
#initialize(wb, config) ⇒ Workbook
Returns a new instance of Workbook.
11 12 13 14 15 |
# File 'lib/smerp/exporter/excel/workbook.rb', line 11 def initialize(wb, config) @inst = wb @config = config @wsRec = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(mtd, *args, &block) ⇒ Object
36 37 38 |
# File 'lib/smerp/exporter/excel/workbook.rb', line 36 def method_missing(mtd, *args, &block) @inst.send(mtd, *args, &block) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/smerp/exporter/excel/workbook.rb', line 10 def config @config end |
#inst ⇒ Object (readonly)
Returns the value of attribute inst.
9 10 11 |
# File 'lib/smerp/exporter/excel/workbook.rb', line 9 def inst @inst end |
Instance Method Details
#worksheet(name, *args, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/smerp/exporter/excel/workbook.rb', line 17 def worksheet(name, *args, &block) ws = @inst.add_worksheet(name: name) wsProxy = Worksheet.new(ws, @config) @wsRec[name] = wsProxy if block block.call(wsProxy) else ws end end |