Sha256: b316cc5480fbb4ab6ab7dacbe37775c8c1e53a53b000b132de97994fc80fbfb8
Contents?: true
Size: 953 Bytes
Versions: 19
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true module Vedeu module Coercers # Provides the mechanism to convert a value into a # {Vedeu::Presentation::Style}. # # @api private # class Style < Vedeu::Coercers::Coercer # Produces new objects of the correct class from the value, # ignores objects that have already been coerced. # # @return [Vedeu::Presentation::Style] def coerce if coerced? value elsif hash?(value) if present?(value[:style]) if value[:style].is_a?(klass) value[:style] else Vedeu::Coercers::Style.coerce(value[:style]) end else klass.new end else klass.new(value) end end private # @return [Class] def klass Vedeu::Presentation::Style end end # Style end # Coercers end # Vedeu
Version data entries
19 entries across 19 versions & 1 rubygems