Module: Fauna::ErrorHelpers

Defined in:
lib/fauna/errors.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.get_or_throw(hash, key) ⇒ Object



217
218
219
220
# File 'lib/fauna/errors.rb', line 217

def self.get_or_throw(hash, key)
  throw :invalid_response unless hash.is_a? Hash and hash.key? key
  hash[key]
end

.map_position(position) ⇒ Object



205
206
207
208
209
210
211
212
213
214
215
# File 'lib/fauna/errors.rb', line 205

def self.map_position(position)
  unless position.nil?
    position.map do |part|
      if part.is_a? String
        part.to_sym
      else
        part
      end
    end
  end
end