Sha256: 9bcfd04c0119550301839ad71c5f80bc6bec14c5e8f4ad16db60b967d5396f4f

Contents?: true

Size: 1.43 KB

Versions: 25

Compression:

Stored size: 1.43 KB

Contents

require 'soap/rpc/driver'

def ferien_fuer_region(proxy, region, year = nil)
  proxy.first_row.upto(proxy.last_row) do |row|
    if proxy.cell(row, 2) == region
      jahr = proxy.cell(row, 1).to_i
      if year.nil? || jahr == year
        bis_datum = proxy.cell(row, 5)
        if DateTime.now > bis_datum
          print '('
        end
        print jahr.to_s + ' '
        print proxy.cell(row, 2) + ' '
        print proxy.cell(row, 3) + ' '
        print proxy.cell(row, 4).to_s + ' '
        print bis_datum.to_s + ' '
        print (proxy.cell(row, 6) || '') + ' '
        if DateTime.now > bis_datum
          print ')'
        end
        puts
      end
    end
  end
end

proxy = SOAP::RPC::Driver.new('http://localhost:12321', 'spreadsheetserver')
proxy.add_method('cell', 'row', 'col')
proxy.add_method('officeversion')
proxy.add_method('last_row')
proxy.add_method('last_column')
proxy.add_method('first_row')
proxy.add_method('first_column')
proxy.add_method('sheets')
proxy.add_method('set_default_sheet', 's')
proxy.add_method('ferien_fuer_region', 'region')

sheets = proxy.sheets
proxy.set_default_sheet(sheets.first)

puts "first row: #{proxy.first_row}"
puts "first column: #{proxy.first_column}"
puts "last row: #{proxy.last_row}"
puts "last column: #{proxy.last_column}"
puts "cell: #{proxy.cell('C', 8)}"
puts "cell: #{proxy.cell('F', 12)}"
puts "officeversion: #{proxy.officeversion}"
puts 'Berlin:'

ferien_fuer_region(proxy, 'Berlin')

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
roo-2.10.1 examples/roo_soap_client.rb
roo-2.10.0 examples/roo_soap_client.rb
roo-2.9.0 examples/roo_soap_client.rb
roo-2.8.3 examples/roo_soap_client.rb
roo-2.8.2 examples/roo_soap_client.rb
roo-2.8.1 examples/roo_soap_client.rb
roo-2.8.0 examples/roo_soap_client.rb
roo-2.7.1 examples/roo_soap_client.rb
roo-2.7.0 examples/roo_soap_client.rb
roo-2.6.0 examples/roo_soap_client.rb
roo-2.5.1 examples/roo_soap_client.rb
roo-2.5.0 examples/roo_soap_client.rb
roo-2.4.0 examples/roo_soap_client.rb
roo-2.3.2 examples/roo_soap_client.rb
roo-2.3.1 examples/roo_soap_client.rb
roo-2.3.0 examples/roo_soap_client.rb
roo-2.2.0 examples/roo_soap_client.rb
roo-2.1.1 examples/roo_soap_client.rb
roo-2.1.0 examples/roo_soap_client.rb
roo-2.0.1 examples/roo_soap_client.rb