instance method draw

Ruby on Rails 2.0.3

Since v1.0.3 Last seen in v2.2.3

Available in: v1.0.3 v1.1.6 v1.2.3 v2.0.3 v2.1.0 v2.2.3

Signature

draw(path = nil, &block)

No documentation comment.

Parameters

path opt = nil
block block
Source
# File lib/importmap/map.rb, line 13
  def draw(path = nil, &block)
    if path && File.exist?(path)
      begin
        instance_eval(File.read(path), path.to_s)
      rescue StandardError => e
        Rails.logger.error "Unable to parse import map from #{path}: #{e.message}"
        raise InvalidFile, "Unable to parse import map from #{path}: #{e.message}"
      end
    elsif block_given?
      instance_eval(&block)
    end

    self
  end

Defined in lib/importmap/map.rb line 13 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Importmap::Map

Type at least 2 characters to search.

↑↓ navigate · open · esc close