Module: Shrine::Plugins::DataUri::AttachmentMethods

Defined in:
lib/shrine/plugins/data_uri.rb

Instance Method Summary collapse

Instance Method Details

#define_model_methods(name) ⇒ Object


40
41
42
43
44
45
46
47
48
49
50
# File 'lib/shrine/plugins/data_uri.rb', line 40

def define_model_methods(name)
  super if defined?(super)

  define_method :"#{name}_data_uri=" do |uri|
    send(:"#{name}_attacher").data_uri = uri
  end

  define_method :"#{name}_data_uri" do
    send(:"#{name}_attacher").data_uri
  end
end