Class: RBlade::CompilesStatements::CompilesHtmlAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/rblade/compiler/statements/compiles_html_attributes.rb

Instance Method Summary collapse

Instance Method Details

#compile_class(args) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rblade/compiler/statements/compiles_html_attributes.rb', line 6

def compile_class(args)
  if args&.count != 1
    raise RBladeTemplateError.new "Class statement: wrong number of arguments (given #{args&.count || 0}, expecting 1)"
  end

  %`@output_buffer.raw_buffer<<-"class=\\"\#{RBlade::ClassManager.new(#{args[0]})}\\"";`
end

#compile_style(args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rblade/compiler/statements/compiles_html_attributes.rb', line 14

def compile_style(args)
  if args&.count != 1
    raise RBladeTemplateError.new "Style statement: wrong number of arguments (given #{args&.count || 0}, expecting 1)"
  end

  %`@output_buffer.raw_buffer<<-"style=\\"\#{RBlade::StyleManager.new(#{args[0]})}\\"";`
end