Class: Blockpile::Base

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

Instance Method Summary collapse

Constructor Details

#initialize(helper, *args, &block) ⇒ Base

Returns a new instance of Base.



3
4
5
6
7
# File 'lib/blockpile/base.rb', line 3

def initialize(helper, *args, &block)
  @helper = helper
  build *args
  @content = capture(self, &block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (protected)



28
29
30
# File 'lib/blockpile/base.rb', line 28

def method_missing(*args, &block)
  @helper.send(*args, &block)
end

Instance Method Details

#buildObject



17
18
19
# File 'lib/blockpile/base.rb', line 17

def build
  # override this method to build your block
end

#get_contentObject



13
14
15
# File 'lib/blockpile/base.rb', line 13

def get_content
  @content
end

#to_htmlObject



9
10
11
# File 'lib/blockpile/base.rb', line 9

def to_html
  render_template
end