Class: Syaso::Base

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

Direct Known Subclasses

List, ListItem

Constant Summary collapse

BLOCK_BUFFER =

--------------------# constants

""

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Base

initialize method

Parameters:

  • context (ActionView)


23
24
25
26
# File 'lib/syaso/base.rb', line 23

def initialize(context)
  super()
  self.context = context
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)


161
162
163
164
165
166
167
# File 'lib/syaso/base.rb', line 161

def method_missing(name, *args, &block)
  begin
    self.content.__send__(name, *args, &block)
  rescue => e
    super
  end
end

Instance Attribute Details

#contentObject

--------------------# attributes



12
13
14
# File 'lib/syaso/base.rb', line 12

def content
  @content
end

Instance Method Details

#render(content = nil, options = {}, &block) ⇒ Object

render content.

Parameters:

  • options (Hash) (defaults to: {})


32
33
34
# File 'lib/syaso/base.rb', line 32

def render(content = nil, options = {}, &block)
  self._render(content, options, &block)
end