Module: Orientdb4r::HashExtension

Defined in:
lib/orientdb4r/rest/model.rb

Overview

Extends a Hash produced by JSON.parse.

Instance Method Summary collapse

Instance Method Details

#get_mandatory_attribute(name) ⇒ Object

Gets an attribute value that has to be presented.

Raises:

  • (::ArgumentError)


10
11
12
13
14
# File 'lib/orientdb4r/rest/model.rb', line 10

def get_mandatory_attribute(name)
  key = name.to_s
  raise ::ArgumentError, "unknown attribute, name=#{key}" unless self.include? key
  self[key]
end