From e4684fb80bd395db77dd104ed4ded9ec858e133e Mon Sep 17 00:00:00 2001 From: Kim Burgestrand Date: Tue, 15 Oct 2024 10:58:42 +0200 Subject: [PATCH] Ruby 3.2 has Data, which can replace ostruct for us --- Gemfile | 1 - Gemfile.lock | 2 -- meetup.rb | 8 ++------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 3ef165c..ca88839 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source "https://rubygems.org" ruby file: ".ruby-version" gem "sinatra" -gem "ostruct" gem "slim" gem "sassc" diff --git a/Gemfile.lock b/Gemfile.lock index 375bd9c..d49e965 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -85,7 +84,6 @@ DEPENDENCIES dotenv foreman logger - ostruct rake rdiscount rspec diff --git a/meetup.rb b/meetup.rb index bf85c4b..7e33316 100644 --- a/meetup.rb +++ b/meetup.rb @@ -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"),