#---
# Excerpted from "Programming Ruby 3.2",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit https://pragprog.com/titles/ruby6 for more book information.
#---
uk_units = Ruby::Box.new
us_units = Ruby::Box.new

uk_units.require_relative("uk_unit_definitions")
us_units.require_relative("us_unit_definitions")

City = Data.define(:name, :units)

chicago = City.new(name: "Chicago", units: us_units)
london = City.new(name: "London", units: uk_units)

puts "The speed of light in #{chicago.name} is #{chicago.units::LIGHT_SPEED}"
puts "The speed of light in #{london.name} is #{london.units::LIGHT_SPEED}"

