$96 GRAYBYTE WORDPRESS FILE MANAGER $74

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby23/lib64/ruby/2.3.0/json/add/

HOME
Current File : /opt/alt/ruby23/lib64/ruby/2.3.0/json/add//rational.rb
# frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
  require 'json'
end
defined?(::Rational) or require 'rational'

class Rational
  # Deserializes JSON string by converting numerator value <tt>n</tt>,
  # denominator value <tt>d</tt>, to a Rational object.
  def self.json_create(object)
    Rational(object['n'], object['d'])
  end

  # Returns a hash, that will be turned into a JSON object and represent this
  # object.
  def as_json(*)
    {
      JSON.create_id => self.class.name,
      'n'            => numerator,
      'd'            => denominator,
    }
  end

  # Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
  def to_json(*)
    as_json.to_json
  end
end


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.43 PM
root / linksafe
0755
bigdecimal.rb
0.585 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
complex.rb
0.732 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
core.rb
0.341 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
date.rb
0.861 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
date_time.rb
1.298 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
exception.rb
0.781 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
ostruct.rb
0.779 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
range.rb
0.769 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
rational.rb
0.763 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
regexp.rb
0.743 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
struct.rb
0.769 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
symbol.rb
0.601 KB
26 Jul 2023 2.39 PM
root / linksafe
0644
time.rb
0.993 KB
26 Jul 2023 2.39 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF