lib/rails_toastify.rb in rails_toastify-1.0.0 vs lib/rails_toastify.rb in rails_toastify-1.1.0
- old
+ new
@@ -12,13 +12,27 @@
self.configuration ||= Configuration.new
yield(configuration)
end
class Configuration
- attr_accessor :framework
+ attr_accessor :position, :animation, :duration, :theme, :type
def initialize
- @framework = :tailwind
+ @position = 'toast-container-bottom-right'
+ @animation = 'bounce'
+ @duration = 5000
+ @theme = 'light'
+ @type = 'default'
+ end
+
+ def to_json
+ {
+ position: @position,
+ animation: @animation,
+ duration: @duration,
+ theme: @theme,
+ type: @type
+ }.to_json
end
end
class Error < StandardError; end
end