Files
news.gitea.happylizard.me/bin/gems/facets-3.1.0/lib/standard/facets/ostruct/merge.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

22 lines
367 B
Ruby

require 'ostruct'
class OpenStruct
# Insert/update hash data on the fly.
#
# o = OpenStruct.new
# o.merge!(:a => 2)
# o.a #=> 2
#
def merge!(other)
raise TypeError, "can't modify frozen #{self.class}", caller(1) if self.frozen?
##other = other.to_hash #to_h?
for k,v in other
@table[k.to_sym] = v
end
self
end
end