Skip to content

Instantly share code, notes, and snippets.

@rohitpaulk
Created October 8, 2017 17:21
Show Gist options
  • Save rohitpaulk/ef148c926a1205b624f443e454c98a82 to your computer and use it in GitHub Desktop.
Save rohitpaulk/ef148c926a1205b624f443e454c98a82 to your computer and use it in GitHub Desktop.
Ruby's Struct
# Create a new class from Struct
Customer = Struct.new(:name, :address)
#=> Customer
Customer.new("Dave", "123 Main")
#=> #<struct Customer name="Dave", address="123 Main">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment