$64 GRAYBYTE WORDPRESS FILE MANAGER $27

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

/opt/alt/ruby21/lib64/ruby/2.1.0/json/add/

HOME
Current File : /opt/alt/ruby21/lib64/ruby/2.1.0/json/add//struct.rb
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
  require 'json'
end

# Struct serialization/deserialization
class Struct

  # Deserializes JSON string by constructing new Struct object with values
  # <tt>v</tt> serialized by <tt>to_json</tt>.
  def self.json_create(object)
    new(*object['v'])
  end

  # Returns a hash, that will be turned into a JSON object and represent this
  # object.
  def as_json(*)
    klass = self.class.name
    klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
    {
      JSON.create_id => klass,
      'v'            => values,
    }
  end

  # Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
  # Only named structs are supported.
  def to_json(*args)
    as_json.to_json(*args)
  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.555 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
complex.rb
0.389 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
core.rb
0.311 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
date.rb
0.867 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
date_time.rb
1.308 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
exception.rb
0.792 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
ostruct.rb
0.791 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
range.rb
0.775 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
rational.rb
0.404 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
regexp.rb
0.751 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
struct.rb
0.776 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
symbol.rb
0.608 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
time.rb
1.009 KB
26 Jul 2023 2.22 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF