Class: GoogleCells::Worksheet
Defined Under Namespace
Classes: UpdateError
Constant Summary
Constants included
from Fetcher
Fetcher::BASE_URL
Instance Method Summary
collapse
Methods included from Util
#concat_url, #e
Methods included from Fetcher
#raw, #request
define_accessors, #initialize
Instance Method Details
#rows ⇒ Object
12
13
14
|
# File 'lib/google_cells/worksheet.rb', line 12
def rows
GoogleCells::CellSelector::RowSelector.new(self)
end
|
#save! ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/google_cells/worksheet.rb', line 16
def save!
return if @changed_cells.nil? || @changed_cells.empty?
batch_url = concat_url(cells_uri, "/batch")
response = request(:post, batch_url, body: to_xml, headers:{
"Content-Type" => "application/atom+xml", "If-Match" => "*"})
doc = Nokogiri.parse(response.body)
doc.css("atom|entry").each{|entry| check_entry_for_errors!(entry) }
@changed_cells = {}
true
end
|
#track_changes(cell) ⇒ Object
28
29
30
31
32
|
# File 'lib/google_cells/worksheet.rb', line 28
def track_changes(cell)
@changed_cells ||= {}
@changed_cells[cell.title] = cell
nil
end
|