Module: Gio::ActionMap

Defined in:
lib/gio2/action-map.rb

Instance Method Summary collapse

Instance Method Details

#add_action(action) ⇒ Object



20
21
22
23
24
# File 'lib/gio2/action-map.rb', line 20

def add_action(action)
  action = convert_to_action(action) unless action.is_a?(Action)
  add_action_raw(action)
  actions[action.name] = action
end

#add_action_rawObject



19
# File 'lib/gio2/action-map.rb', line 19

alias_method :add_action_raw, :add_action

#add_actions(actions) ⇒ Object



32
33
34
35
36
# File 'lib/gio2/action-map.rb', line 32

def add_actions(actions)
  actions.each do |action|
    add_action(action)
  end
end

#remove_action(name) ⇒ Object



27
28
29
30
# File 'lib/gio2/action-map.rb', line 27

def remove_action(name)
  remove_action_raw(name)
  actions.delete(name)
end

#remove_action_rawObject



26
# File 'lib/gio2/action-map.rb', line 26

alias_method :remove_action_raw, :remove_action