class ExpressMailer::Image
Attributes
alt[RW]
background[RW]
shape[RW]
size[RW]
url[RW]
Public Class Methods
create(attrs)
click to toggle source
# File lib/express_mailer/image.rb, line 5 def self.create(attrs) if attrs new(attrs) else nil end end
new(options = {})
click to toggle source
# File lib/express_mailer/image.rb, line 13 def initialize(options = {}) @url = options.fetch(:url) @alt = options.fetch(:alt) @background = options.fetch(:background, 'transparent') @shape = options.fetch(:shape, :normal) # :normal, :circle, :rounded @size = options.fetch(:size, :normal) # :normal, :large end
Public Instance Methods
height()
click to toggle source
# File lib/express_mailer/image.rb, line 25 def height @size.to_sym == :large ? 240 : 120 end
shape_class()
click to toggle source
# File lib/express_mailer/image.rb, line 21 def shape_class "shape-#{shape}" end