Sha256: 6588e5dabad9698494ac3769ca0e845434e205424c3d7b8e45867c9a6f20b8bb
Contents?: true
Size: 761 Bytes
Versions: 34
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true require 'active_model/attribute_set' module ActiveGraph class AttributeSet < ActiveModel::AttributeSet def initialize(attr_hash, attr_list) hashmap = ActiveGraph::LazyAttributeHash.new(attr_hash, attr_list) super(hashmap) end def method_missing(name, *args, **kwargs, &block) if defined?(name) attributes.send(:materialize).send(name, *args, **kwargs, &block) else super end end def respond_to_missing?(method, *) attributes.send(:materialize).respond_to?(method) || super end def keys attributes.send(:materialize).keys end def ==(other) other.is_a?(ActiveGraph::AttributeSet) ? super : to_hash == other end end end
Version data entries
34 entries across 34 versions & 1 rubygems