Class: Spreadsheet::ParseExcel::Worksheet::Cell

### Home Classes Methods

### In Files

- lib/parseexcel/parseexcel.rb

### Parent

Object

### Methods

- ::new
- #date
- #datetime
- #to_f
- #to_i
- #to_s
- #type

### Files

- LICENSE.txt
- Manifest.txt

### Class/Module Index

Quicksearch

- Spreadsheet
- Spreadsheet::Column
- Spreadsheet::Compatibility
- Spreadsheet::Datatypes
- Spreadsheet::Encodings
- Spreadsheet::Errors
- Spreadsheet::Excel
- Spreadsheet::Excel::Error
- Spreadsheet::Excel::ExcelCompatibleWorkbook
- Spreadsheet::Excel::Internals
- Spreadsheet::Excel::Internals::Biff5
- Spreadsheet::Excel::Internals::Biff8
- Spreadsheet::Excel::Offset
- Spreadsheet::Excel::Password
- Spreadsheet::Excel::Reader
- Spreadsheet::Excel::Reader::Biff5
- Spreadsheet::Excel::Rgb
- Spreadsheet::Excel::Row
- Spreadsheet::Excel::SstEntry
- Spreadsheet::Excel::Workbook
- Spreadsheet::Excel::Worksheet
- Spreadsheet::Font
- Spreadsheet::Format
- Spreadsheet::Formula
- Spreadsheet::Helpers
- Spreadsheet::Link
- Spreadsheet::Note
- Spreadsheet::NoteObject
- Spreadsheet::ParseExcel
- Spreadsheet::ParseExcel::Worksheet
- Spreadsheet::ParseExcel::Worksheet::Cell
- Spreadsheet::Row
- Spreadsheet::Workbook
- Spreadsheet::Worksheet
- Spreadsheet::Writer

No matching classes.

# Spreadsheet::ParseExcel::Worksheet::Cell

### Attributes

annotation[RW]
book[RW]
code[RW]
encoding[RW]
format[RW]
kind[RW]
numeric[RW]
rich[RW]
value[RW]

### Public Class Methods

new(value, format, row, idx) click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 24
    def initialize value, format, row, idx
      @format = format
      @idx = idx
      @row = row
      @value = value
      @encoding = Spreadsheet.client_encoding
    end

### Public Instance Methods

date() click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 31
    def date
      @row.date @idx
    end

datetime() click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 34
    def datetime
      @row.datetime @idx
    end

to_f() click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 40
    def to_f
      @value.to_f
    end

to_i() click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 37
    def to_i
      @value.to_i
    end

to_s(target_encoding=nil) click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 43
    def to_s(target_encoding=nil)
      if(target_encoding)
        begin
          Iconv.new(target_encoding, @encoding).iconv(@value)
        rescue
          Iconv.new(target_encoding, 'ascii').iconv(@value.to_s)
        end
      else
        @value.to_s
      end
    end

type() click to toggle source

    # File lib/parseexcel/parseexcel.rb, line 54
    def type
      if @format && (@format.date? || @format.time?)
        :date
      elsif @value.is_a?(Numeric)
        :numeric
      else
        :text
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.