Class: Fixnum

### Home Classes Methods

### In Files

- lib/ffi_yajl/ffi/encoder.rb
- lib/ffi_yajl/json_gem.rb

### Parent

Object

### Methods

- #ffi_yajl
- #to_json

### Files

- LICENSE
- MIT-LICENSE

### Class/Module Index

Quicksearch

- FFI_Yajl
- FFI_Yajl::Benchmark
- FFI_Yajl::Benchmark::Encode
- FFI_Yajl::Benchmark::EncodeProfile
- FFI_Yajl::Benchmark::Parse
- FFI_Yajl::Benchmark::ParseProfile
- FFI_Yajl::Benchmark::ParseProfileRubyProf
- FFI_Yajl::EncodeError
- FFI_Yajl::Encoder
- FFI_Yajl::FFI
- FFI_Yajl::FFI::Encoder
- FFI_Yajl::FFI::Parser
- FFI_Yajl::ParseError
- FFI_Yajl::Parser
- FFI_Yajl::Platform
- FFI_Yajl::YajlCallbacks
- JSON
- JSON::GeneratorError
- JSON::JSONError
- JSON::ParserError
- Array
- Bignum
- Date
- DateTime
- FalseClass
- Fixnum
- Float
- Hash
- Kernel
- NilClass
- Object
- String
- Symbol
- Time
- TrueClass

No matching classes.

# Fixnum

### Public Instance Methods

ffi_yajl(yajl_gen, state) click to toggle source

    # File lib/ffi_yajl/ffi/encoder.rb, line 139
    def ffi_yajl(yajl_gen, state)
      str = self.to_s
      if str == "NaN" || str == "Infinity" || str == "-Infinity"
        raise ::FFI_Yajl::EncodeError.new("'#{str}' is an invalid number")
      end
      if state[:processing_key]
        if ( status = FFI_Yajl.yajl_gen_string(yajl_gen, str, str.bytesize) ) != 0
          FFI_Yajl::Encoder.raise_error_for_status(status)
        end
      else
        if ( status = FFI_Yajl.yajl_gen_integer(yajl_gen, self) ) != 0
          FFI_Yajl::Encoder.raise_error_for_status(status)
        end
      end
    end

to_json(*opts, &block) click to toggle source

    # File lib/ffi_yajl/json_gem.rb, line 71
    def to_json(*opts, &block)
      FFI_Yajl::Encoder.encode(self, *opts)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.