Open structs create new objects while a Struct defines a class that already has attributes, an equality method (==), and is enumerable.

require 'ostruct'
car1 = "car", color: "red")
car2 = "car", color: "red")
car3 = "car", color: "blue")

car1 == car2  # => true
car1 == car3  # => false

While you can’t define a method on and OpenStruct, one advantage they have is that you can add a new attribute to it after it has been defined. You can’t do this with a Struct.

require 'ostruct'
car = "Toyota")
car.type # => "Toyota"

car.mpg  # => nil 
car.mpg = 30
car.mpg  # => 30