Class: Glimmer::DSL::Web::FormattingElementExpression

Inherits:
Expression
  • Object
show all
Includes:
GeneralElementExpression
Defined in:
lib/glimmer/dsl/web/formatting_element_expression.rb

Instance Method Summary collapse

Instance Method Details

#add_content(parent, keyword, *args, &block) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/glimmer/dsl/web/formatting_element_expression.rb', line 24

def add_content(parent, keyword, *args, &block)
  if parent.is_a?(String)
    parent
  else
    super(parent, keyword, *args, &block)
  end
end

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/glimmer/dsl/web/formatting_element_expression.rb', line 11

def can_interpret?(parent, keyword, *args, &block)
  Glimmer::Web::FormattingElementProxy.keyword_supported?(keyword, parent: parent) ||
    Glimmer::Web::ElementProxy.keyword_supported?(keyword)
end

#interpret(parent, keyword, *args, &block) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/glimmer/dsl/web/formatting_element_expression.rb', line 16

def interpret(parent, keyword, *args, &block)
  if Glimmer::Web::FormattingElementProxy.keyword_supported?(keyword, parent: parent)
    Glimmer::Web::FormattingElementProxy.format(keyword, *args, &block)
  else
    super(parent, keyword, *args, &block)
  end
end