Sha256: 14b9f5d9e0907b2cd2a2de9c71073d3c5ec257e769961d3f26a259dc4a2fcef0

Contents?: true

Size: 531 Bytes

Versions: 16

Compression:

Stored size: 531 Bytes

Contents

class Date
    def as_json
        strftime("%Y-%m-%d")
    end 
end

def Time
    def as_json
        xmlschema
    end
end

def Symbol
    def as_json
        to_s
    end
end

class Numeric
  def to_json(options = nil) #:nodoc:
    to_s
  end

  def as_json(options = nil) #:nodoc:
    self
  end
end

class Float
  def to_json(options = nil) #:nodoc:
    to_s
  end
end

class Integer
  def to_json(options = nil) #:nodoc:
    to_s
  end
end

def BigDecimal
   def to_json(options = nil) #:nodoc:
       to_f.to_json
   end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spiderfw-0.6.15 lib/spiderfw/utils/json.rb
spiderfw-0.6.14 lib/spiderfw/utils/json.rb
spiderfw-0.6.13 lib/spiderfw/utils/json.rb
spiderfw-0.6.12 lib/spiderfw/utils/json.rb
spiderfw-0.6.11 lib/spiderfw/utils/json.rb
spiderfw-0.6.10 lib/spiderfw/utils/json.rb
spiderfw-0.6.9 lib/spiderfw/utils/json.rb
spiderfw-0.6.8 lib/spiderfw/utils/json.rb
spiderfw-0.6.7 lib/spiderfw/utils/json.rb
spiderfw-0.6.6 lib/spiderfw/utils/json.rb
spiderfw-0.6.5 lib/spiderfw/utils/json.rb
spiderfw-0.6.4 lib/spiderfw/utils/json.rb
spiderfw-0.6.3 lib/spiderfw/utils/json.rb
spiderfw-0.6.2 lib/spiderfw/utils/json.rb
spiderfw-0.6.1 lib/spiderfw/utils/json.rb
spiderfw-0.6.0 lib/spiderfw/utils/json.rb