metro 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,44 +0,0 @@
1
- module Metro
2
- module SceneView
3
- class Drawer
4
-
5
- # The window is necessary as all drawing elements created require
6
- # an access to this instance.
7
- attr_reader :window
8
-
9
- # The scene is necessary to ensure that any fields which contain
10
- # variables within the application are properly interpolated.
11
- attr_reader :scene
12
-
13
- def initialize(scene)
14
- @scene = scene
15
- @window = scene.window
16
- after_initialize
17
- end
18
-
19
- def after_initialize ; end
20
-
21
- def components
22
- @components ||= begin
23
- Hash.new(UnsupportedComponent).merge label: Label.new(scene),
24
- select: Select.new(scene)
25
- end
26
- end
27
-
28
- #
29
- # Render all the view elements defined that are supported by this drawer.
30
- #
31
- def draw(view)
32
- view.each do |name,content|
33
- component = content['type'].to_sym
34
- components[component].draw(content)
35
- end
36
- end
37
-
38
- end
39
- end
40
- end
41
-
42
- require_relative 'unsupported_component'
43
- require_relative 'label'
44
- require_relative 'select'
@@ -1,9 +0,0 @@
1
- module Metro
2
- module SceneView
3
- class UnsupportedComponent < Drawer
4
- def self.draw(view)
5
- #log.warn "The component #{view['type']} does not have a supported drawer."
6
- end
7
- end
8
- end
9
- end