Sha256: 5ef644567968ab11da1acbc66960af0572818fdb3036c7bd51747c87d890d89e

Contents?: true

Size: 270 Bytes

Versions: 6

Compression:

Stored size: 270 Bytes

Contents

require 'rules/parameters/parameter'

module Rules::Parameters
  class Attribute < Parameter
    def evaluate(attributes = {})
      if Rules.config.missing_attributes_are_nil?
        attributes[key]
      else
        attributes.fetch(key)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rules-1.1.1 lib/rules/parameters/attribute.rb
rules-1.1.0 lib/rules/parameters/attribute.rb
rules-1.0.0 lib/rules/parameters/attribute.rb
rules-0.1.2 lib/rules/parameters/attribute.rb
rules-0.1.1 lib/rules/parameters/attribute.rb
rules-0.1.0 lib/rules/parameters/attribute.rb