Class: Rack::App::FrontEnd::Helpers::HtmlDsl::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/front_end/helpers/html_dsl/block.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Block

Returns a new instance of Block.



3
4
5
6
# File 'lib/rack/app/front_end/helpers/html_dsl/block.rb', line 3

def initialize(&block)
  @html = ''
  instance_exec(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



12
13
14
15
16
# File 'lib/rack/app/front_end/helpers/html_dsl/block.rb', line 12

def method_missing(method_name, *args, &block)
  @html << ::Rack::App::FrontEnd::Helpers::HtmlDsl.build(method_name, *args, &block)
rescue ::Rack::App::FrontEnd::Helpers::HtmlDsl::UnImplementedError
  super
end

Instance Method Details

#to_sObject



8
9
10
# File 'lib/rack/app/front_end/helpers/html_dsl/block.rb', line 8

def to_s
  @html
end