Sha256: f7df503e621ed1595b76ea8320b4e24f6ab8c069659c7aeefabee0a62e9eccc0
Contents?: true
Size: 828 Bytes
Versions: 5
Compression:
Stored size: 828 Bytes
Contents
# frozen_string_literal: true require_relative 'validation' require_relative '../../model' module Lino module Builders module Mixins module Arguments include Validation def initialize(state) @arguments = Hamster::Vector.new(state[:arguments] || []) super end def with_argument(argument) return self if nil?(argument) return self if empty?(argument.to_s) with(arguments: @arguments.add(Model::Argument.new(argument))) end def with_arguments(arguments) return self if nil_or_empty?(arguments) arguments.inject(self) { |s, argument| s.with_argument(argument) } end private def state super.merge(arguments: @arguments) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems