Class: Shoes::ProxyArray

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
shoes-core/lib/shoes/list_box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(array, gui) ⇒ ProxyArray

Returns a new instance of ProxyArray.



7
8
9
10
# File 'shoes-core/lib/shoes/list_box.rb', line 7

def initialize(array, gui)
  @gui = gui
  super(array)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'shoes-core/lib/shoes/list_box.rb', line 12

def method_missing(method, *args, &block)
  res = super(method, *args, &block)
  gui.update_items

  case res
  when ProxyArray, Array
    self
  else
    res
  end
end

Instance Attribute Details

#guiObject

Returns the value of attribute gui.



5
6
7
# File 'shoes-core/lib/shoes/list_box.rb', line 5

def gui
  @gui
end

Instance Method Details

#to_aObject



24
25
26
# File 'shoes-core/lib/shoes/list_box.rb', line 24

def to_a
  __getobj__
end