Sha256: e7ea952fcc1898aa5c03435a564d4d2e9023b182edc3a4209428b72998f5244d
Contents?: true
Size: 498 Bytes
Versions: 11
Compression:
Stored size: 498 Bytes
Contents
module RubyIsds module Responses class Body def initialize(response) (response.keys - self.class::REMOVED_KEYS).each do |key| self.class.send(:attr_accessor, key.to_sym) instance_variable_set("@#{key}", parsed_value(response[key])) end end private def parsed_value(value) return value unless value.is_a?(Hash) value.keys.first == 'xsi:nil' && value.values.first == 'true' ? nil : false end end end end
Version data entries
11 entries across 11 versions & 1 rubygems