Sha256: d680c9c5c0a1ec36965c7695cc3ed6be646d3ba098858b1af34c975f44fa46a6

Contents?: true

Size: 391 Bytes

Versions: 20

Compression:

Stored size: 391 Bytes

Contents

module Compony
  module ModelFields
    class Email < Base
      def value_for(data, controller: nil, **_)
        return transform_and_join(data.send(@name), controller:) do |el|
          fail('Must pass controller to generate the link to the email.') unless controller
          return nil unless el
          return controller.helpers.mail_to(el)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
compony-0.5.2 lib/compony/model_fields/email.rb
compony-0.5.1 lib/compony/model_fields/email.rb
compony-0.5.0 lib/compony/model_fields/email.rb
compony-0.4.1 lib/compony/model_fields/email.rb
compony-0.4.0 lib/compony/model_fields/email.rb
compony-0.3.3 lib/compony/model_fields/email.rb
compony-0.3.2 lib/compony/model_fields/email.rb
compony-0.3.1 lib/compony/model_fields/email.rb
compony-0.3.0 lib/compony/model_fields/email.rb
compony-0.2.3 lib/compony/model_fields/email.rb
compony-0.2.2 lib/compony/model_fields/email.rb
compony-0.2.1 lib/compony/model_fields/email.rb
compony-0.2.0 lib/compony/model_fields/email.rb
compony-0.1.1 lib/compony/model_fields/email.rb
compony-0.1.0 lib/compony/model_fields/email.rb
compony-0.0.9 lib/compony/model_fields/email.rb
compony-0.0.8 lib/compony/model_fields/email.rb
compony-0.0.7 lib/compony/model_fields/email.rb
compony-0.0.6 lib/compony/model_fields/email.rb
compony-0.0.5 lib/compony/model_fields/email.rb