Class: GoogleDrive::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/google_drive/worksheet_formatting.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(worksheet, row, col, value) ⇒ Cell

Returns a new instance of Cell.



8
9
10
11
12
13
# File 'lib/google_drive/worksheet_formatting.rb', line 8

def initialize(worksheet, row, col, value)
  @worksheet = worksheet
  @row = row
  @col = col
  @value = value
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



6
7
8
# File 'lib/google_drive/worksheet_formatting.rb', line 6

def col
  @col
end

#rowObject (readonly)

Returns the value of attribute row.



6
7
8
# File 'lib/google_drive/worksheet_formatting.rb', line 6

def row
  @row
end

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/google_drive/worksheet_formatting.rb', line 6

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

等価性



18
19
20
21
22
23
24
25
# File 'lib/google_drive/worksheet_formatting.rb', line 18

def ==(other)
  case other
  when GoogleDrive::Cell
    @value == other.value
  else
    @value == other
  end
end

#background_color=(color) ⇒ Object



35
36
37
# File 'lib/google_drive/worksheet_formatting.rb', line 35

def background_color=(color)
  @worksheet.set_background_color(@row, @col, 1, 1, color)
end

#encodingObject



31
32
33
# File 'lib/google_drive/worksheet_formatting.rb', line 31

def encoding
  @value.respond_to?(:encoding) ? value.encoding : nil
end

#to_sObject



27
28
29
# File 'lib/google_drive/worksheet_formatting.rb', line 27

def to_s
  @value.to_s
end