Class: Lich::Common::GUI::CallbackParams

Inherits:
Object
  • Object
show all
Defined in:
documented/common/gui/parameter_objects.rb

Overview

Represents the callback parameters for various UI actions.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CallbackParams

Initializes a new instance of CallbackParams.

Parameters:

  • params (Hash) (defaults to: {})

    a hash of callback parameters

  • params (:on_play) (defaults to: {})

    [Proc] Callback for play button

  • params (:on_remove) (defaults to: {})

    [Proc] Callback for remove action

  • params (:on_save) (defaults to: {})

    [Proc] Callback for save action

  • params (:on_error) (defaults to: {})

    [Proc] Callback for error handling

  • params (:on_theme_change) (defaults to: {})

    [Proc] Callback for theme change

  • params (:on_layout_change) (defaults to: {})

    [Proc] Callback for layout change

  • params (:on_sort_change) (defaults to: {})

    [Proc] Callback for sort change

  • params (:on_persistent_launcher_change) (defaults to: {})

    [Proc] Callback for persistent launcher change

  • params (:on_add_character) (defaults to: {})

    [Proc] Callback for adding a character

  • params (:on_favorites_change) (defaults to: {})

    [Proc] Callback for favorites change

  • params (:on_favorites_reorder) (defaults to: {})

    [Proc] Callback for reordering favorites

Options Hash (params):

  • :on_play (Proc)

    Callback for play button



104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'documented/common/gui/parameter_objects.rb', line 104

def initialize(params = {})
  @on_play = params[:on_play]
  @on_remove = params[:on_remove]
  @on_save = params[:on_save]
  @on_error = params[:on_error]
  @on_theme_change = params[:on_theme_change]
  @on_layout_change = params[:on_layout_change]
  @on_sort_change = params[:on_sort_change]
  @on_persistent_launcher_change = params[:on_persistent_launcher_change]
  @on_add_character = params[:on_add_character]
  @on_favorites_change = params[:on_favorites_change]
  @on_favorites_reorder = params[:on_favorites_reorder]
end

Instance Attribute Details

#on_add_characterObject

Returns the value of attribute on_add_character.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_add_character
  @on_add_character
end

#on_errorObject

Returns the value of attribute on_error.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_error
  @on_error
end

#on_favorites_changeObject

Returns the value of attribute on_favorites_change.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_favorites_change
  @on_favorites_change
end

#on_favorites_reorderObject

Returns the value of attribute on_favorites_reorder.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_favorites_reorder
  @on_favorites_reorder
end

#on_layout_changeObject

Returns the value of attribute on_layout_change.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_layout_change
  @on_layout_change
end

#on_persistent_launcher_changeObject

Returns the value of attribute on_persistent_launcher_change.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_persistent_launcher_change
  @on_persistent_launcher_change
end

#on_playObject

Returns the value of attribute on_play.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_play
  @on_play
end

#on_removeObject

Returns the value of attribute on_remove.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_remove
  @on_remove
end

#on_saveObject

Returns the value of attribute on_save.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_save
  @on_save
end

#on_sort_changeObject

Returns the value of attribute on_sort_change.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_sort_change
  @on_sort_change
end

#on_theme_changeObject

Returns the value of attribute on_theme_change.



85
86
87
# File 'documented/common/gui/parameter_objects.rb', line 85

def on_theme_change
  @on_theme_change
end

Instance Method Details

#to_hObject



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'documented/common/gui/parameter_objects.rb', line 118

def to_h
  {
    on_play: @on_play,
    on_remove: @on_remove,
    on_save: @on_save,
    on_error: @on_error,
    on_theme_change: @on_theme_change,
    on_layout_change: @on_layout_change,
    on_sort_change: @on_sort_change,
    on_persistent_launcher_change: @on_persistent_launcher_change,
    on_add_character: @on_add_character,
    on_favorites_change: @on_favorites_change,
    on_favorites_reorder: @on_favorites_reorder
  }
end