Sha256: 2fca414143f415ed817390c0a2f0778b501e9dce586ad028ab5bbd83ddd960ea
Contents?: true
Size: 801 Bytes
Versions: 12
Compression:
Stored size: 801 Bytes
Contents
module Selenium module WebDriver module Remote class Response attr_accessor :code attr_writer :payload def initialize yield self if block_given? assert_ok end def error if payload['error'] JSON.parse(payload['value']) end end def [](key) payload[key] end def payload @payload ||= {} end private def assert_ok if @code.nil? || @code > 400 if e = error() raise Error.for_remote_class(e['class']), e['message'] else raise ServerError, self end end end end # Response end # Remote end # WebDriver end # Selenium
Version data entries
12 entries across 12 versions & 1 rubygems