# class Listen::Options

### Public Class Methods

new(opts, defaults) click to toggle source

    # File lib/listen/options.rb, line 3
    def initialize(opts, defaults)
      @options = {}
      given_options = opts.dup
      defaults.keys.each do |key|
        @options[key] = given_options.delete(key) || defaults[key]
      end

      return if given_options.empty?

      msg = "Unknown options: #{given_options.inspect}"
      Celluloid::Logger.warn msg
      fail msg
    end

### Public Instance Methods

method_missing(name, *_) click to toggle source

    # File lib/listen/options.rb, line 17
    def method_missing(name, *_)
      return @options[name] if @options.key?(name)
      msg = "Bad option: #{name.inspect} (valid:#{@options.keys.inspect})"
      fail NameError, msg
    end