Class: Syaso::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/syaso/base.rb

Direct Known Subclasses

List, ListItem

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Base

initialize method

Parameters:

  • context (ActionView)


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

Parameters:

  • name (Symbol)
  • args (Array)


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

#contentObject

——————–# 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(options = {}, &block)
  self._render(options, &block)
end