class OpenStruct

def initialize(hash=nil)


data # => #

data = OpenStruct.new(hash)
hash = { "country" => "Australia", :capital => "Canberra" }
require "ostruct"

For example:
(can be a Hash, an OpenStruct or a Struct).
The optional +hash+, if given, will generate attributes and values

object will have no attributes.
Creates a new OpenStruct object. By default, the resulting OpenStruct
def initialize(hash=nil)
  if HAS_PERFORMANCE_WARNINGS && Warning[:performance]
     warn "OpenStruct use is discouraged for performance reasons", uplevel: 1, category: :performance
  end
  if hash
    update_to_values!(hash)
  else
    @table = {}
  end
end