Module: Workbook::Modules::RawObjectsStorage
Instance Method Summary (collapse)
-
- (Object) add_raw(raw_object)
A raw is a 'raw' object, representing a workbook, or cell, or whatever...
-
- (Boolean) has_raw_for?(raw_object_class)
Returns true if there is a template for a certain class, otherwise false.
- - (Object) raws
- - (Object) remove_all_raws!
- - (Object) return_raw_for(raw_object_class)
Instance Method Details
- (Object) add_raw(raw_object)
A raw is a 'raw' object, representing a workbook, or cell, or whatever... in a particular format (defined by its class)
6 7 8 |
# File 'lib/workbook/modules/raw_objects_storage.rb', line 6 def add_raw raw_object raws[raw_object.class]=raw_object end |
- (Boolean) has_raw_for?(raw_object_class)
Returns true if there is a template for a certain class, otherwise false
11 12 13 14 |
# File 'lib/workbook/modules/raw_objects_storage.rb', line 11 def has_raw_for? raw_object_class raws.each { |tc,t| return true if tc == raw_object_class} return false end |
- (Object) raws
25 26 27 28 |
# File 'lib/workbook/modules/raw_objects_storage.rb', line 25 def raws @raws = {} unless defined? @raws @raws end |
- (Object) remove_all_raws!
21 22 23 |
# File 'lib/workbook/modules/raw_objects_storage.rb', line 21 def remove_all_raws! @raws = {} end |
- (Object) return_raw_for(raw_object_class)
16 17 18 19 |
# File 'lib/workbook/modules/raw_objects_storage.rb', line 16 def return_raw_for raw_object_class raws.each { |tc,t| return t if tc == raw_object_class} return nil end |