Usage of Ruby's Safe Navigation Operator (&.) is causing issues when using Ruby versions < 2.3.0

Open
#9 1 comment 0 reactions 1 assignee View on GitHub

@marcandre is already working on this.

Since Jul 31, 2019.

Assessment

This issue has not been assessed yet.

Description

The respond_to_missing function in lib/ostruct.rb is causing issues when using versions of Ruby < 2.3.0

def respond_to_missing?(mid, include_private = false) # :nodoc:
    mname = mid.to_s.chomp("=").to_sym
    @table&.key?(mname) || super
end

Line 196 uses the &. (Safe Navigation Operator) which was introduced in Ruby 2.3.0.

If you want to use the Safe Navigation Operator then please specify the required_ruby_version property in the ostruct.gemspec file

Dominant language
Ruby
Stars
175
Forks
35
Avg merge
16h 14m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/ostruct

All issues in ruby/ostruct

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.