class Sequent::Core::Helpers::ArrayWithType

Attributes

item_type[RW]

Public Class Methods

new(item_type) click to toggle 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

candidate?(value) click to toggle source
# File lib/sequent/core/helpers/array_with_type.rb, line 23
def candidate?(value)
  value.is_a?(Array)
end
deserialize_from_json(value) click to toggle source
# File lib/sequent/core/helpers/array_with_type.rb, line 15
def deserialize_from_json(value)
  value.nil? ? nil : value.map { |item| item_type.deserialize_from_json(item) }
end
to_s() click to toggle source
# File lib/sequent/core/helpers/array_with_type.rb, line 19
def to_s
  "Sequent::Core::Helpers::ArrayWithType.new(#{item_type})"
end