Class: Syaso::Base
- Inherits:
-
Object
- Object
- Syaso::Base
- Defined in:
- lib/syaso/base.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
——————–# attributes.
Instance Method Summary collapse
-
#initialize(context) ⇒ Base
constructor
initialize method.
- #render(options = {}, &block) ⇒ Object
Constructor Details
#initialize(context) ⇒ Base
initialize method
21 22 23 24 25 26 |
# File 'lib/syaso/base.rb', line 21 def initialize(context) super() self.context = context #@@default_html_tag ||= :div #@@default_html_class ||= [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
method missing
106 107 108 109 110 111 112 |
# File 'lib/syaso/base.rb', line 106 def method_missing(name, *args, &block) begin self.content.__send__(name, *args, &block) rescue => e super end end |
Instance Attribute Details
#content ⇒ Object
——————–# attributes
10 11 12 |
# File 'lib/syaso/base.rb', line 10 def content @content end |
Instance Method Details
#render(options = {}, &block) ⇒ Object
28 29 30 |
# File 'lib/syaso/base.rb', line 28 def render( = {}, &block) self._render(, &block) end |