Module: Skyline::Rendering::Scopes::Interface Abstract
- Defined in:
- lib/skyline/rendering/scopes/interface.rb
Overview
This module is abstract.
Implement this interface in classes that can be used as renderable scopes.
Class Method Summary collapse
- .load_from_serialized_string(serialized_string) ⇒ Object abstract
- .unserialize(serialized_string) ⇒ Object
Instance Method Summary collapse
- #renderer(options = {}) ⇒ Object abstract
- #serialize ⇒ Object abstract
- #templates_for(klass_or_obj) ⇒ Object
Class Method Details
.load_from_serialized_string(serialized_string) ⇒ Object
This method is abstract.
16 17 18 |
# File 'lib/skyline/rendering/scopes/interface.rb', line 16 def self.load_from_serialized_string(serialized_string) raise "self.load_from_serialized_string() must be overridden" end |
.unserialize(serialized_string) ⇒ Object
20 21 22 23 |
# File 'lib/skyline/rendering/scopes/interface.rb', line 20 def self.unserialize(serialized_string) class_name, params = serialized_string.split("-") class_name.constantize.load_from_serialized_string(params.to_s) end |
Instance Method Details
#renderer(options = {}) ⇒ Object
This method is abstract.
6 7 8 |
# File 'lib/skyline/rendering/scopes/interface.rb', line 6 def renderer( = {}) raise "renderer(options = {}) must be overridden" end |
#serialize ⇒ Object
This method is abstract.
11 12 13 |
# File 'lib/skyline/rendering/scopes/interface.rb', line 11 def serialize raise "serialize() must be overridden" end |
#templates_for(klass_or_obj) ⇒ Object
25 26 27 |
# File 'lib/skyline/rendering/scopes/interface.rb', line 25 def templates_for(klass_or_obj) self.renderer.templates_for(klass_or_obj) end |