Class: Glimmer::DSL::Libui::ContentExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/glimmer/dsl/libui/content_expression.rb

Instance Method Summary collapse

Instance Method Details

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

TODO rename to ContentDataBindingExpression given it is no longer a static_expression (and update in dsl.rb)

Returns:

  • (Boolean)


29
30
31
32
33
34
# File 'lib/glimmer/dsl/libui/content_expression.rb', line 29

def can_interpret?(parent, keyword, *args, &block)
  keyword == 'content' &&
    block_given? &&
    args.size > 0 &&
    parent&.respond_to?(:bind_content)
end

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



36
37
38
# File 'lib/glimmer/dsl/libui/content_expression.rb', line 36

def interpret(parent, keyword, *args, &block)
  parent.bind_content(*args, &block)
end