Sha256: 96bbd87443c2ca3e53551c9edaacc8f5199f56c88f69c5bca18be62894c47338

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

module Acl9
  module Prepositions
    VALID_PREPOSITIONS = %w(of for in on at by).freeze unless defined? VALID_PREPOSITIONS

    def _by_preposition options
      object = nil

      VALID_PREPOSITIONS.each do |prep|
        if options[prep.to_sym]
          raise ArgumentError, "You may only use one preposition to specify object" if object

          object = options[prep.to_sym]
        end
      end
      object
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acl9-1.3.0 lib/acl9/prepositions.rb