Sha256: a733ccf55ce628e3c8d51f30873383899f5b9e2e71d847502a2d7cbf68f6a58e
Contents?: true
Size: 439 Bytes
Versions: 12
Compression:
Stored size: 439 Bytes
Contents
# frozen_string_literal: true require 'active_support' class DHS::Data module Becomes extend ActiveSupport::Concern def becomes(klass, options = {}) return self if self.instance_of?(klass) && !is_a?(DHS::Data) data = DHS::Data.new(_raw, _parent, klass) data.errors = options[:errors] if options[:errors] data.warnings = options[:warnings] if options[:warnings] klass.new(data) end end end
Version data entries
12 entries across 12 versions & 1 rubygems