Class: RailsDevtools::Pin

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_devtools/importmaps/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, to, preload, vendor) ⇒ Pin

Returns a new instance of Pin.



53
54
55
56
57
58
# File 'lib/rails_devtools/importmaps/base.rb', line 53

def initialize(name, to, preload, vendor)
  @name = name
  @to = to
  @preload = preload
  @vendor = vendor
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



51
52
53
# File 'lib/rails_devtools/importmaps/base.rb', line 51

def name
  @name
end

#preloadObject (readonly)

Returns the value of attribute preload.



51
52
53
# File 'lib/rails_devtools/importmaps/base.rb', line 51

def preload
  @preload
end

#toObject (readonly)

Returns the value of attribute to.



51
52
53
# File 'lib/rails_devtools/importmaps/base.rb', line 51

def to
  @to
end

#vendorObject (readonly)

Returns the value of attribute vendor.



51
52
53
# File 'lib/rails_devtools/importmaps/base.rb', line 51

def vendor
  @vendor
end

Instance Method Details

#file_pathObject



60
61
62
# File 'lib/rails_devtools/importmaps/base.rb', line 60

def file_path
  @file_path ||= @vendor ? vendor_path_to(to) : local_javascript_path_to(to)
end

#pathObject



64
65
66
# File 'lib/rails_devtools/importmaps/base.rb', line 64

def path
  @path ||= frontend_path(to)
end