rubocop:disable Metrics/MethodLength
166844
def download_to(dir = Dir.pwd, opts = { force_download: false })
      delete_files!(dir) if opts[:force_download]

      return if file_exist?(dir)

      image = Tools.get(uri)

      append_file_data(dir, image)
      append_file_ext(dir)
    rescue StandardError => error
      logger.error({
        msg: 'Failed to download page',
        page: self,
        uri: uri,
        error: error,
        error_msg: error.message,
        backtrace: error.backtrace
      }.to_s)
    end
114317
def method_missing(method_symbol, *method_args)
      if method_args.length > 0
        _set(method_symbol, method_args.first)
      end

      _get(method_symbol)
    end
1143209
def method_missing(name, *args, &block)
      if @type.has_attribute?(name.to_s)
        __attribute__(name, *args)
      else
        __tag__(name, *args, &block)
      end
    end
725462
def method_missing(method_name, *args, &block)
      config = Loquacious::Configuration.for method_name, &block
      raise Adhearsion::Configuration::ConfigurationError.new "Invalid plugin #{method_name}" if config.nil?
      config
    end
1248753
def method_missing(sym, *ignore)
    key = sym.to_s
    index = @keys.index(key)
    if index
      @values.at(index)
    else
      raise RuntimeError.new("unknown field: " + key)
    end
  end
280914
def instance_writers
      _attrs.keys.map { |m| "#{m}=".to_sym }.select { |m| method_defined?(m) }
    end
1297243
def def_method(object, method_name, filename=nil)
      m = object.is_a?(Module) ? :module_eval : :instance_eval
      object.__send__(m, "def #{method_name}; #{@src}; end", filename || @filename || '(erubis)')
    end
216658
def method_missing(method_id, *args)
      if [:get, :post, :put, :delete].include?(method_id)
        path, options = *args
        options ||= {}
        options[:query] = (default_params.merge(options[:query] || {}))
        options[:headers] = (self.class.default_options[:headers].merge(options[:headers] || {}))

        CrowdFlower.request_hook.call(method_id, path, options) do
          self.class.send(method_id, url(path), options)
        end
      else
        super
      end
    end
1081329
def method_missing(method, *args, &block)
      # Check string keys first, original and downcase
      string_method = method.to_s

      if raw_hash.key?(string_method)
        return self[string_method]
      elsif raw_hash.key?(string_method.downcase)
        return self[string_method.downcase]
      end

      if string_method =~ /[A-Z+]/
        string_method = string_method.snakecase
      end

      index = string_method.downcase.to_sym
      # Check symbol key and return local hash entry.
      return self[index] if raw_hash.has_key?(index)
      # Then delegate to hash object.
      if raw_hash.respond_to?(method)
        return raw_hash.send(method, *args)
      end
      # Finally return nil.
      nil
    end
1120907
def method_missing(method, *args)
      super unless args.empty?

      if @ifds.first.respond_to?(method)
        @ifds.first.send(method)
      elsif TAGS.include?(method)
        @ifds.first.to_hash[method]
      else
        super
      end
    end
26450
def method_missing(method_name, *_args)
      if attrs.key?(method_name.to_s)
        attrs[method_name.to_s]
      else
        super(method_name)
      end
    end
364199
def [](input)
      key = __convert_key(input)
      return @__config.key_error.call(key) if not key?(key)

      super(key)
    end
836953
def method_array
      @parser = nil
      @caller_lines.each do |kaller|
        code   = Ripper.sexp(kaller.contents)
        code  ||= Ripper.sexp(kaller.contents.sub(/^\W*(if|unless)/, ''.freeze)) # if and unless "block" statements aren't valid one line ruby code
        code  ||= Ripper.sexp(kaller.contents.sub(/do \|.*\|$/, ''.freeze)) # remove trailing do |thing| to make valid code
        code  ||= Ripper.sexp(kaller.contents.sub(/(and|or)\W*$/, ''.freeze))# trailing and || or
        code  ||= Ripper.sexp(kaller.contents.sub(/:\W*$/, ''.freeze)) # multi line ternary statements
        code  ||= Ripper.sexp(kaller.contents.sub(/(^\W*)|({ \|?.*\|?)}/, ''.freeze)) # multi line blocks using {}

        puts "LetItGoFailed parse (#{kaller.file_name}:#{kaller.line_number}: \n  \033[0;31m"+ kaller.contents.strip + "\e[0m".freeze if ENV['LET_IT_GO_RECORD_FAILED_CODE'] && code.nil? && kaller.contents.match(/"|'/)

        parser = ::LetItGo::WTFParser.new(code, contents: kaller.contents)

        if parser.each_method.any? { |m| m.method_name == method_name }
          @line_number = kaller.line_number
          @file_name   = kaller.file_name

          @parser = parser
          parser.each_method.each(&:arg_types)
          break
        else
          next
        end
      end
      @parser || []
    end
353468
def method_missing(name, *args, &block)
      if args.empty? && !block_given? && @arg_names.include?(name)
        @args[name]
      else
        super
      end
    end
1072451
def method_missing(method, *args)
      attr_name, suffix = method.to_s.scan(/([a-z0-9\_]+)(\?|\=)?$/i).first
      if suffix == ATTR_SETTER
        @_metaclass.send(:attr_accessor, attr_name)
        @_fields << attr_name.to_sym
        send(method, args.first)
      elsif attr_name && @_fields.include?(attr_name.to_sym)
        value = @attrs[attr_name.to_sym]
        case suffix
        when nil
          @_metaclass.send(:attr_accessor, attr_name)
          value
        when ATTR_PREDICATE then !!value
        end
      elsif suffix.nil? && SPECIAL_METHODS.include?(attr_name)
        instance_variable_get "@_#{attr_name}"
      elsif attr_name && !@_fields.include?(attr_name.to_sym)
        nil
      else
        super
      end
    end
781497
def method_missing(sym, *args, &block)
      cache_method_call(sym) if ::Builder::XmlBase.cache_method_calls
      tag!(sym, *args, &block)
    end
237926
def [](attr)
      return nil unless instance_variable_defined?(:@attributes) and @attributes.is_a?(Hash)
      @attributes[attr] or (attr.is_a?(String) ? @attributes[attr.to_sym] : @attributes[attr.to_s])
    end