Module: Metro::SceneView
- Included in:
- Scene
- Defined in:
- lib/metro/views/scene_view.rb
Overview
SceneView provides support for a Scene to have a view as well as giving additional tools to also help draw that view.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
When the module is included insure that all the class helper methods are added at the same time.
Instance Method Summary collapse
-
#save_view ⇒ Object
Saves the current content of the view back through the view’s writer.
-
#view ⇒ Object
The view for this scene.
-
#view_content ⇒ Object
Loads and caches the view content based on the avilable view parsers and the view files defined.
-
#view_name ⇒ Object
A Scene by default uses the name of the Scene to find it’s associated view.
Class Method Details
.included(base) ⇒ Object
When the module is included insure that all the class helper methods are added at the same time.
67 68 69 |
# File 'lib/metro/views/scene_view.rb', line 67 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#save_view ⇒ Object
Saves the current content of the view back through the view’s writer
58 59 60 61 |
# File 'lib/metro/views/scene_view.rb', line 58 def save_view view.content = self.to_hash view.save end |
#view ⇒ Object
Returns the view for this scene.
41 42 43 |
# File 'lib/metro/views/scene_view.rb', line 41 def view self.class.view end |
#view_content ⇒ Object
Loads and caches the view content based on the avilable view parsers and the view files defined.
51 52 53 |
# File 'lib/metro/views/scene_view.rb', line 51 def view_content view.content end |
#view_name ⇒ Object
A Scene by default uses the name of the Scene to find it’s associated view.
34 35 36 |
# File 'lib/metro/views/scene_view.rb', line 34 def view_name self.class.view_name end |