Skip to content

Commit

Permalink
Ruby 3.2 has Data, which can replace ostruct for us
Browse files Browse the repository at this point in the history
  • Loading branch information
Burgestrand committed Oct 15, 2024
1 parent e1438bc commit e4684fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source "https://rubygems.org"
ruby file: ".ruby-version"

gem "sinatra"
gem "ostruct"

gem "slim"
gem "sassc"
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ GEM
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
ostruct (0.6.0)
public_suffix (6.0.1)
racc (1.8.1)
rack (3.1.8)
Expand Down Expand Up @@ -85,7 +84,6 @@ DEPENDENCIES
dotenv
foreman
logger
ostruct
rake
rdiscount
rspec
Expand Down
8 changes: 2 additions & 6 deletions meetup.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
require "ostruct"

class Meetup
class Result < OpenStruct; end

Meetup = Data.define(:name, :url, :time, :description, :venue_name, :venue_address) do
def self.upcoming
[
Result.new(
new(
name: "Ruby Meetup with Hemnet",
url: "https://rubymeetup.confetti.events/signup",
time: Time.parse("2024-03-13 17:30 CEST"),
Expand Down

0 comments on commit e4684fb

Please sign in to comment.