class Eth::Rlp::Sedes::List

def initialize(elements: [], strict: true)

Parameters:
  • strict (Boolean) -- an option to enforce the given structure.
  • elements (Array) -- an array indicating the structure of the list.
def initialize(elements: [], strict: true)
  super()
  @strict = strict
  elements.each do |e|
    if Sedes.sedes?(e)
      push e
    elsif Util.list?(e)
      push List.new(elements: e)
    else
      raise TypeError, "Instances of List must only contain sedes objects or nested sequences thereof."
    end
  end
end