Class: Rack::App::FrontEnd::Helpers::HtmlDsl::Block
- Inherits:
-
Object
- Object
- Rack::App::FrontEnd::Helpers::HtmlDsl::Block
- Defined in:
- lib/rack/app/front_end/helpers/html_dsl/block.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Block
constructor
A new instance of Block.
- #method_missing(method_name, *args, &block) ⇒ Object
- #to_s ⇒ Object
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_s ⇒ Object
8 9 10 |
# File 'lib/rack/app/front_end/helpers/html_dsl/block.rb', line 8 def to_s @html end |