Class: AMA::Entity::Mapper::Type::BuiltIn::ArrayType

Inherits:
EnumerableType show all
Defined in:
lib/ama-entity-mapper/type/builtin/array_type.rb

Overview

Even though it is functionally unnecessary, end users are more likely to call ‘Mapper.map(input, Array)` rather than `Mapper.map(input, Enumerable)`. Because mapper has no right to make assumptions about type children, it would have to back off to standard hash-based normalization/denormalization, and that would cause end-user frustration

Constant Summary collapse

INSTANCE =
new

Instance Attribute Summary

Attributes inherited from AMA::Entity::Mapper::Type

#attributes, #denormalizer, #enumerator, #factory, #injector, #normalizer, #parameters, #type, #virtual

Instance Method Summary collapse

Methods included from Mixin::Errors

#compliance_error, #mapping_error, #raise_if_internal, #validation_error

Methods inherited from AMA::Entity::Mapper::Type

#==, #attribute!, #eql?, #hash, #instance!, #instance?, #parameter!, #resolve, #resolve_parameter, #resolved!, #resolved?, #to_def, #to_s, #valid!, #valid?, #violations

Methods included from Mixin::HandlerSupport

declare_handler_block_setter, declare_handler_getter, declare_handler_method, declare_handler_setter, declare_namespace_method, included

Methods included from Mixin::Reflection

#install_object_method, #method_object, #object_variable, #object_variable_exists, #object_variables, #set_object_attribute

Constructor Details

#initializeArrayType

Returns a new instance of ArrayType.



17
18
19
20
# File 'lib/ama-entity-mapper/type/builtin/array_type.rb', line 17

def initialize
  super
  self.type = Array
end