Sha256: 724d3c7f46d3ecfb59206a5446549251c176addf3236cc3f83b4758e1701bf39

Contents?: true

Size: 435 Bytes

Versions: 16

Compression:

Stored size: 435 Bytes

Contents

module AttachmentMagick
  class CustomStyle
    
    def method_missing(meth, *args, &blk)
      instance_variable_set "@#{meth}", args.first
      self.class.class_eval { attr_reader meth.to_sym }
    end
    
    def styles
      hash = {}
      instance_variables.each do |method|
        method = method.to_s.gsub("@", "")
        hash.merge!({ method.to_sym => send(method) })
      end
      
      return hash
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
attachment_magick-0.3.6 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3.5 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3.4 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3.3 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3.2 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3.1 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.3 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.7 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.6 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.5 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.4 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.3 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.2 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.1 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.2.0 lib/attachment_magick/configuration/custom_style.rb
attachment_magick-0.1.0 lib/attachment_magick/configuration/custom_style.rb