module Shrine::Attacher::ClassMethods
Attributes
Returns the Shrine class that this attacher class is namespaced under.
Public Instance Methods
Source
# File lib/shrine/attacher.rb 25 def from_data(data, **) 26 attacher = new(**) 27 attacher.load_data(data) 28 attacher 29 end
Initializes the attacher from a data hash generated from Attacher#data.
attacher = Attacher.from_data({ "id" => "...", "storage" => "...", "metadata" => {} }) attacher.file #=> #<Shrine::UploadedFile>
Source
# File lib/shrine/attacher.rb 17 def inspect 18 "#{shrine_class.inspect}::Attacher" 19 end