Module: MarkMapper::Plugins::Keys::Static

Extended by:
ActiveSupport::Concern
Included in:
Document
Defined in:
lib/mark_mapper/plugins/keys/static.rb

Defined Under Namespace

Modules: ClassMethods Classes: MissingKeyError

Instance Method Summary collapse

Instance Method Details

#read_key(name) ⇒ Object


17
18
19
20
21
22
23
# File 'lib/mark_mapper/plugins/keys/static.rb', line 17

def read_key(name)
  if !self.class.static_keys || self.class.key?(name)
    super
  else
    raise MissingKeyError, "Tried to read the key #{name.inspect}, but no key was defined. Either define key :#{name} or set self.static_keys = false"
  end
end