Delegate dig to the hash which defines the item

This commit is contained in:
Dan Milne
2019-10-11 15:11:49 +11:00
parent 5f396898b5
commit cbe74541a0

View File

@@ -1,8 +1,13 @@
require 'nameable' require 'nameable'
require 'forwardable'
module Paapi module Paapi
class Item class Item
extend Forwardable
attr_accessor :hash attr_accessor :hash
def_delegators :@hash, :dig
def initialize(data) def initialize(data)
@hash = data @hash = data
end end