Class: RailsAssist::TemplateLanguage::Haml

Inherits:
Base
  • Object
show all
Defined in:
lib/rails_artifactor/template_language/haml.rb

Instance Method Summary collapse

Instance Method Details

#insert_ruby_block(statement, options = {}, &block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rails_artifactor/template_language/haml.rb', line 8

def insert_ruby_block statement, options = {}, &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, options = {}
  "\n= #{statement}"
end

#insert_tag(tag, options = {}, &block) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/rails_artifactor/template_language/haml.rb', line 16

def insert_tag tag, options= {}, &block
  attributes = options[:attributes]
  atr_atr = "{#{format attributes}}" if attributes
  %Q{"%#{tag}#{atr_atr}"
#{yield}
<#{tag}/>
}
end