Class: RobustExcelOle::Cell
- Defined in:
- lib/robust_excel_ole/cell.rb
Instance Attribute Summary collapse
-
#cell ⇒ Object
readonly
Returns the value of attribute cell.
Instance Method Summary collapse
-
#initialize(win32_cell) ⇒ Cell
constructor
A new instance of Cell.
-
#method_missing(name, *args) ⇒ Object
:nodoc:.
- #v ⇒ Object
Methods inherited from REOCommon
#excel, #own_methods, puts_hash, tr1, trace
Constructor Details
#initialize(win32_cell) ⇒ Cell
Returns a new instance of Cell.
7 8 9 10 11 12 13 |
# File 'lib/robust_excel_ole/cell.rb', line 7 def initialize(win32_cell) @cell = if win32_cell.MergeCells win32_cell.MergeArea.Item(1,1) else win32_cell end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
:nodoc:
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/robust_excel_ole/cell.rb', line 19 def method_missing(name, *args) # :nodoc: #if name.to_s[0,1] =~ /[A-Z]/ begin @cell.send(name, *args) rescue WIN32OLERuntimeError => msg if msg. =~ /unknown property or method/ raise VBAMethodMissingError, "unknown VBA property or method #{name.inspect}" else raise msg end end # else # super # end end |
Instance Attribute Details
#cell ⇒ Object (readonly)
Returns the value of attribute cell
5 6 7 |
# File 'lib/robust_excel_ole/cell.rb', line 5 def cell @cell end |
Instance Method Details
#v ⇒ Object
15 16 17 |
# File 'lib/robust_excel_ole/cell.rb', line 15 def v self.Value end |