class Sequent::Core::Helpers::ArrayWithType
Attributes
Public Class Methods
Source
# File lib/sequent/core/helpers/array_with_type.rb, line 9 def initialize(item_type) fail 'needs a item_type' unless item_type @item_type = item_type end
Public Instance Methods
Source
# File lib/sequent/core/helpers/array_with_type.rb, line 23 def candidate?(value) value.is_a?(Array) end
Source
# File lib/sequent/core/helpers/array_with_type.rb, line 15 def deserialize_from_json(value) value&.map { |item| item_type.deserialize_from_json(item) } end
Source
# File lib/sequent/core/helpers/array_with_type.rb, line 19 def to_s "Sequent::Core::Helpers::ArrayWithType.new(#{item_type})" end