Sha256: aac26f5c7e435fe6ef6e83c84d88e07f024e743a0fa8f77e9fe11a2def41e696

Contents?: true

Size: 283 Bytes

Versions: 17

Compression:

Stored size: 283 Bytes

Contents

module Intercom
  module RequiresParameters

    def requires_parameters(parameters, required)
      missing = Array(required) - parameters.keys.map(&:to_s)
      raise ArgumentError.new("Missing required parameters (#{missing.join(', ')}).") unless missing.empty?
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
intercom-1.0.0 lib/intercom/requires_parameters.rb
intercom-0.3.0 lib/intercom/requires_parameters.rb
intercom-0.2.3 lib/intercom/requires_parameters.rb
intercom-0.2.2 lib/intercom/requires_parameters.rb
intercom-0.2.1 lib/intercom/requires_parameters.rb
intercom-0.2.0 lib/intercom/requires_parameters.rb
intercom-0.1.19 lib/intercom/requires_parameters.rb
intercom-0.1.17 lib/intercom/requires_parameters.rb
intercom-0.1.16 lib/intercom/requires_parameters.rb
intercom-0.1.15 lib/intercom/requires_parameters.rb
intercom-0.1.14 lib/intercom/requires_parameters.rb
intercom-0.1.13 lib/intercom/requires_parameters.rb
intercom-0.1.12 lib/intercom/requires_parameters.rb
intercom-0.1.11 lib/intercom/requires_parameters.rb
intercom-0.1.10 lib/intercom/requires_parameters.rb
intercom-0.1.9 lib/intercom/requires_parameters.rb
intercom-0.1.8 lib/intercom/requires_parameters.rb