module Fend::Plugins::Coercions::InstanceMethods

Public Instance Methods

process_input(data) click to toggle source
Calls superclass method
# File lib/fend/plugins/coercions.rb, line 225
def process_input(data)
  data = super || data
  coerce(data)
end
type_schema() click to toggle source
# File lib/fend/plugins/coercions.rb, line 215
def type_schema
  schema = self.class.type_schema

  return {} if schema.nil?

  raise Error, "type schema must be hash" unless schema.is_a?(Hash)

  schema
end

Private Instance Methods

coerce(data) click to toggle source
# File lib/fend/plugins/coercions.rb, line 232
def coerce(data)
  coercer.call(data, type_schema)
end
coercer() click to toggle source
# File lib/fend/plugins/coercions.rb, line 236
def coercer
  @_coercer ||= Coercer.new(self.class::Coerce.new)
end