Sha256: 04c695c951c9e16721cdf0b3850d4d7add9cbfe06bf96f14e874d3210ea29cd3
Contents?: true
Size: 525 Bytes
Versions: 49
Compression:
Stored size: 525 Bytes
Contents
# frozen_string_literal: true class LHC::Response::Data::Item < OpenStruct include LHC::Response::Data::Base def initialize(response, data: nil) @response = response @data = data set_dynamic_accessor_methods super(as_json) end def [](key) @hash ||= as_json.with_indifferent_access @hash[key] end private def set_dynamic_accessor_methods as_json.keys.each do |key| define_singleton_method key do |*args| as_open_struct.send key, *args end end end end
Version data entries
49 entries across 49 versions & 1 rubygems