class Label attr_reader :response, :name, :data def initialize response @response = response @name = response.dig("nome") @data = response.dig("dados") end def download_file File.write(@name, Base64.decode64(@data)) end end