Class SuperStruct
In: lib/whois/answer/super_struct.rb
Parent: Struct

SuperStruct

SuperStruct is an enhanced version of the Ruby Standar library Struct.

Compared with the original version, it provides the following additional features:

  • ability to initialize an instance from Hash
  • ability to pass a block on creation

Methods

new  

Public Class methods

Overwrites the standard Struct initializer to add the ability to create an instance from a Hash of parameters.

  attributes = { :foo => 1, :bar => "baz" }
  Struct.new(attributes)
  # => #<Struct foo=1, bar="baz">

If block is given, the block is called on self.

[Validate]