Sha256: c5a681f5620ffadd69033319f60e4478bbe116c612098700d19e60747fb22978

Contents?: true

Size: 926 Bytes

Versions: 3

Compression:

Stored size: 926 Bytes

Contents

if ::RUBY_VERSION >= '1.9'
  require 'ensure/encoding'
end

class RemoteTable  
  class Format
    autoload :Excel, 'remote_table/format/excel'
    autoload :Excelx, 'remote_table/format/excelx'
    autoload :Delimited, 'remote_table/format/delimited'
    autoload :OpenOffice, 'remote_table/format/open_office'
    autoload :FixedWidth, 'remote_table/format/fixed_width'
    autoload :HTML, 'remote_table/format/html'
    
    autoload :Textual, 'remote_table/format/mixins/textual'
    autoload :Rooable, 'remote_table/format/mixins/rooable'
    
    attr_reader :t

    def initialize(t)
      @t = t
    end
    
    def utf8(str)
      if ::RUBY_VERSION >= '1.9'
        str.ensure_encoding 'UTF-8', :external_encoding => t.properties.encoding, :invalid_characters => :transcode
      else
        str
      end
    end
    
    include ::Enumerable
    def each
      raise "must be defined by format"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
remote_table-1.1.9 lib/remote_table/format.rb
remote_table-1.1.8 lib/remote_table/format.rb
remote_table-1.1.7 lib/remote_table/format.rb