Sha256: 097a0dfa0335e675f252afeab5b20fdf4f73aeb2d49803381d72920ea3a129a6
Contents?: true
Size: 692 Bytes
Versions: 9
Compression:
Stored size: 692 Bytes
Contents
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
9 entries across 9 versions & 1 rubygems