Class: Contactology::Stash

Inherits:
Hashie::Trash
  • Object
show all
Defined in:
lib/contactology/stash.rb

Overview

A Stash is a ‘suppressing’ Hashie::Trash where keys that are not defined are simply ignored and unavailable to the local object.

A Stash is useful when you need to read data from another application, but you only want a predefined subset of the returned data to become available, locally.

Instance Method Summary collapse

Instance Method Details

#[]=(property, value) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/contactology/stash.rb', line 15

def []=(property, value)
  if self.class.translations.include? property.to_sym
    send("#{property}=", value)
  elsif property_exists? property
    super
  end
end