Sha256: 926ad4a352660d2cb9d92be2fb6dc3acf42de9681c0c2a6245c9c10adee68207

Contents?: true

Size: 508 Bytes

Versions: 13

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Props
    class NestedProps < Playbook::Props::Base
      def initialize(nested_kit:, **kwargs)
        super **kwargs
        @nested_kit = nested_kit
      end

      def validate(values)
        return true if values.nil?

        @nested_kit.props.each do |prop_key, definition|
          definition.validate! definition.value(values[prop_key])
        end
        true
      rescue Playbook::Props::Error
        false
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
playbook_ui-9.19.0 lib/playbook/props/nested_props.rb
playbook_ui-9.19.0.pre.alphafonts lib/playbook/props/nested_props.rb
playbook_ui-9.18.0.flow.bin.alpha lib/playbook/props/nested_props.rb
playbook_ui-9.18.0 lib/playbook/props/nested_props.rb
playbook_ui-9.17.0 lib/playbook/props/nested_props.rb
playbook_ui-9.16.0 lib/playbook/props/nested_props.rb
playbook_ui-9.15.0 lib/playbook/props/nested_props.rb
playbook_ui-9.14.1.alpha.radio.alignment lib/playbook/props/nested_props.rb
playbook_ui-9.14.1.alpha.highcharts9 lib/playbook/props/nested_props.rb
playbook_ui-9.14.1 lib/playbook/props/nested_props.rb
playbook_ui-9.13.0 lib/playbook/props/nested_props.rb
playbook_ui-9.12.0 lib/playbook/props/nested_props.rb
playbook_ui-9.12.0.pre.text.addon lib/playbook/props/nested_props.rb