Class: Glimmer::DSL::Opal::FontExpression

Inherits:
Expression
  • Object
show all
Includes:
TopLevelExpression
Defined in:
lib/glimmer/dsl/opal/font_expression.rb

Overview

font expression Note: Cannot be a static expression because it clashes with font property expression

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


34
35
36
37
38
39
# File 'lib/glimmer/dsl/opal/font_expression.rb', line 34

def can_interpret?(parent, keyword, *args, &block)
  keyword.to_s == 'font' and     
    (parent.nil? || !parent.respond_to?('font')) and
    args.size == 1 and 
    args.first.is_a?(Hash)
end

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



41
42
43
# File 'lib/glimmer/dsl/opal/font_expression.rb', line 41

def interpret(parent, keyword, *args, &block)
  Glimmer::SWT::FontProxy.new(*args)
end