Class: RailsToastify::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_toastify.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rails_toastify.rb', line 20

def initialize
  @position = 'toast-container-top-right'
  @notice_animation = 'bounce'
  @alert_animation = 'zoom'
  @notice_duration = 3000
  @alert_duration = 3000
  @notice_theme = 'light'
  @alert_theme = 'light'
  @notice_type = 'default'
  @alert_type = 'error'
end

Instance Attribute Details

#alert_animationObject

Returns the value of attribute alert_animation.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def alert_animation
  @alert_animation
end

#alert_durationObject

Returns the value of attribute alert_duration.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def alert_duration
  @alert_duration
end

#alert_themeObject

Returns the value of attribute alert_theme.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def alert_theme
  @alert_theme
end

#alert_typeObject

Returns the value of attribute alert_type.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def alert_type
  @alert_type
end

#notice_animationObject

Returns the value of attribute notice_animation.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def notice_animation
  @notice_animation
end

#notice_durationObject

Returns the value of attribute notice_duration.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def notice_duration
  @notice_duration
end

#notice_themeObject

Returns the value of attribute notice_theme.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def notice_theme
  @notice_theme
end

#notice_typeObject

Returns the value of attribute notice_type.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def notice_type
  @notice_type
end

#positionObject

Returns the value of attribute position.



17
18
19
# File 'lib/rails_toastify.rb', line 17

def position
  @position
end

Instance Method Details

#to_hObject



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rails_toastify.rb', line 32

def to_h
  {
    position: @position,
    notice_animation: @notice_animation,
    alert_animation: @alert_animation,
    notice_duration: @notice_duration,
    alert_duration: @alert_duration,
    notice_theme: @notice_theme,
    alert_theme: @alert_theme,
    notice_type: @notice_type,
    alert_type: @alert_type
  }
end