module Shrine::Attachment::ClassMethods

Attributes

shrine_class[RW]

Returns the Shrine class that this attachment class is namespaced under.

Public Instance Methods

[](*args, **options) click to toggle source

Shorthand for ‘Attachment.new`.

Shrine::Attachment[:image]
# File lib/shrine/attachment.rb, line 25
def [](*args, **options)
  new(*args, **options)
end
inspect() click to toggle source

Since Attachment is anonymously subclassed when Shrine is subclassed, and then assigned to a constant of the Shrine subclass, make inspect reflect the likely name for the class.

# File lib/shrine/attachment.rb, line 18
def inspect
  "#{shrine_class.inspect}::Attachment"
end