Sha256: 7f9e28a5a0b55c3ab24541f67137656f68be410556724fda3c3f510693240aa4

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

require 'glimmer/dsl/expression'
require 'glimmer/dsl/top_level_expression'
require 'glimmer/swt/cursor_proxy'

module Glimmer
  module DSL
    module SWT
      # cursor expression
      # Note: Cannot be a static expression because it clashes with cursor property expression
      class CursorExpression < Expression
        include TopLevelExpression
  
        def can_interpret?(parent, keyword, *args, &block)
          keyword.to_s == 'cursor' and
          (parent.nil? or !parent.respond_to?('cursor')) and
            args.size == 1 and
            (args.first.is_a?(Integer) or textual?(args.first))
        end
  
        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::CursorProxy.new(*args)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glimmer-dsl-swt-0.6.1 lib/glimmer/dsl/swt/cursor_expression.rb
glimmer-dsl-swt-0.6.0 lib/glimmer/dsl/swt/cursor_expression.rb