Method: JsonDoc::Document#getPropSingle

Defined in:
lib/jsondoc/document.rb

#getPropSingle(yKey = nil) ⇒ Object

Raises:

  • (ArgumentError)


88
89
90
91
92
93
94
95
96
# File 'lib/jsondoc/document.rb', line 88

def getPropSingle(yKey = nil)
  raise ArgumentError, 'E_BAD_KEY__IS_NIL' if yKey.nil?
  yKey = yKey.to_sym if yKey.is_a?(String)
  xxVal = @dDocument.key?(yKey) ? @dDocument[yKey] : nil
  if xxVal.nil? && @bIsStrict
    self.validateKey(yKey)
  end
  xxVal
end