Class: Shirka::View

Inherits:
Object
  • Object
show all
Includes:
Eventalk
Defined in:
lib/shirka/view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Eventalk

#add_watcher, #fire, #forward, #watch, #watchers

Constructor Details

#initialize(controller, data = nil) ⇒ View

Returns a new instance of View.



9
10
11
12
13
14
# File 'lib/shirka/view.rb', line 9

def initialize(controller, data=nil)
  @controller = controller
  @data = data
  watch @controller
  init data
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



5
6
7
# File 'lib/shirka/view.rb', line 5

def controller
  @controller
end

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/shirka/view.rb', line 6

def data
  @data
end

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/shirka/view.rb', line 7

def label
  @label
end

Instance Method Details

#build(widget) ⇒ Object



40
41
# File 'lib/shirka/view.rb', line 40

def build(widget)       
end

#init(data) ⇒ Object



16
17
# File 'lib/shirka/view.rb', line 16

def init(data)
end

#on_component_added(data = nil) ⇒ Object



37
38
# File 'lib/shirka/view.rb', line 37

def on_component_added(data=nil)
end

#on_view_added(view, slot = nil) ⇒ Object



22
23
# File 'lib/shirka/view.rb', line 22

def on_view_added(view, slot=nil)
end

#on_view_adding(view, slot = nil) ⇒ Object



19
20
# File 'lib/shirka/view.rb', line 19

def on_view_adding(view, slot=nil)
end

#style(widget) ⇒ Object



43
44
# File 'lib/shirka/view.rb', line 43

def style(widget)
end

#widgetObject



28
29
30
31
32
33
34
35
# File 'lib/shirka/view.rb', line 28

def widget
  return @widget unless @widget.nil?
  
  @widget = widget_class.new
  build @widget
  style @widget
  @widget   
end

#widget_classObject



25
26
# File 'lib/shirka/view.rb', line 25

def widget_class
end