Class: RobustExcelOle::Cell

Inherits:
Range show all
Defined in:
lib/robust_excel_ole/cell.rb

Instance Attribute Summary

Attributes inherited from Range

#ole_range, #worksheet

Instance Method Summary collapse

Methods inherited from Range

#==, #[], #columns, #copy, #each, #rows, #values

Methods inherited from VbaObjects

#to_reo

Constructor Details

#initialize(win32_cell, worksheet) ⇒ Cell

attr_reader :ole_cell



10
11
12
13
# File 'lib/robust_excel_ole/cell.rb', line 10

def initialize(win32_cell, worksheet)
  super
  ole_cell
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object (private)



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/robust_excel_ole/cell.rb', line 44

def method_missing(name, *args) 
  super unless name.to_s[0,1] =~ /[A-Z]/
  if ::ERRORMESSAGE_JRUBY_BUG
    begin
      @ole_range.send(name, *args)
    rescue Java::OrgRacobCom::ComFailException 
      raise VBAMethodMissingError, "unknown VBA property or method #{name.inspect}"
    end
  else
    begin
      @ole_range.send(name, *args)
    rescue NoMethodError 
      raise VBAMethodMissingError, "unknown VBA property or method #{name.inspect}"
    end
  end
end

Instance Method Details

#valueObject



15
16
17
# File 'lib/robust_excel_ole/cell.rb', line 15

def value
  self.Value
end

#value=(value) ⇒ Object



19
20
21
# File 'lib/robust_excel_ole/cell.rb', line 19

def value=(value)
  self.Value = value
end