Class: RailsAssist::TemplateLanguage::Haml
- Defined in:
- lib/rails_artifactor/template_language/haml.rb
Instance Method Summary collapse
- #insert_ruby_block(statement, options = {}, &block) ⇒ Object
- #insert_ruby_statement(statement, options = {}) ⇒ Object
- #insert_tag(tag, options = {}, &block) ⇒ Object
Instance Method Details
#insert_ruby_block(statement, options = {}, &block) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/rails_artifactor/template_language/haml.rb', line 7 def insert_ruby_block statement, = {}, &block # get indentation of previous line %Q{"<%= #{statement} %>" #{yield} <% end %> } end |
#insert_ruby_statement(statement, options = {}) ⇒ Object
4 5 6 |
# File 'lib/rails_artifactor/template_language/haml.rb', line 4 def insert_ruby_statement statement, = {} "\n= #{statement}" end |
#insert_tag(tag, options = {}, &block) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rails_artifactor/template_language/haml.rb', line 15 def insert_tag tag, = {}, &block attributes = [:attributes] atr_atr = "{#{format attributes}}" if attributes %Q{"%#{tag}#{atr_atr}" #{yield} <#{tag}/> } end |