module Scrivito class ObjClassData def initialize(raw_data) raw_data = raw_data.deep_stringify_keys if type = raw_data['type'] raw_data['is_binary'] = %w[image generic].include?(type) end @raw_data = raw_data end def id @raw_data['id'] end def name @raw_data['name'] end def is_active !!@raw_data['is_active'] end def is_binary !!@raw_data['is_binary'] end def type @raw_data['type'] end def attributes @raw_data['attributes'] || [] end end end