Skip to content

Commit

Permalink
fix: Upgrade for compatibility with Ruby 3 (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickevansuk authored Jun 17, 2024
1 parent bb28116 commit ab6bc64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7']
ruby-version: ['2.7', '3.0', '3.1']

steps:
- uses: actions/checkout@v2
Expand Down
10 changes: 6 additions & 4 deletions lib/openactive/concerns/json_ld_serializable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ def property(field, as:)

def values
data = {}
self.class.properties.each do |key, field:|
data[key] = send(field)
self.class.properties.each do |key, field|
field_value = field[:field]
data[key] = send(field_value)
end
data
end

def to_h
data = {}
self.class.properties.each do |_key, field:|
data[field] = send(field)
self.class.properties.each do |_key, field|
field_value = field[:field]
data[field_value] = send(field_value)
end
data
end
Expand Down

0 comments on commit ab6bc64

Please sign in to comment.