Sha256: 0ac61a5908bf0f4e8dca1de483808f326feb26cced5a91042210cb8f16088fd3

Contents?: true

Size: 520 Bytes

Versions: 11

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  module Shortcuts
    module Properties
      extend Grumlin::Shortcuts

      shortcut :props do |**props|
        props.reduce(self) do |tt, (prop, value)| # rubocop:disable Style/EachWithObject
          next tt.property(prop, value) unless value.nil? # nils are not supported

          tt
        end
      end

      shortcut :hasAll do |**props|
        props.reduce(self) do |tt, (prop, value)|
          tt.has(prop, value)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
grumlin-0.20.2 lib/grumlin/shortcuts/properties.rb
grumlin-0.20.1 lib/grumlin/shortcuts/properties.rb
grumlin-0.20.0 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.7 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.6 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.5 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.4 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.3 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.2 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.1 lib/grumlin/shortcuts/properties.rb
grumlin-0.19.0 lib/grumlin/shortcuts/properties.rb