Class: Glimmer::DSL::SWT::BindExpression
- Inherits:
-
StaticExpression
- Object
- StaticExpression
- Glimmer::DSL::SWT::BindExpression
- Defined in:
- lib/glimmer/dsl/swt/bind_expression.rb
Overview
Responsible for setting up the return value of the bind keyword (command symbol) as a ModelBinding. It is then used by another command handler like DataBindingCommandHandler for text and selection properties on Text and Spinner or TableItemsDataBindingCommandHandler for items in a Table
Instance Method Summary collapse
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/glimmer/dsl/swt/bind_expression.rb', line 33 def can_interpret?(parent, keyword, *args, &block) ( keyword == 'bind' and ( ( (args.size == 2) and textual?(args[1]) ) || ( (args.size == 3) and textual?(args[1]) and (args[2].is_a?(Hash)) ) ) ) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
50 51 52 53 54 |
# File 'lib/glimmer/dsl/swt/bind_expression.rb', line 50 def interpret(parent, keyword, *args, &block) = args[2] || {} [:on_read] = .delete(:on_read) || .delete('on_read') || block DataBinding::ModelBinding.new(args[0], args[1].to_s, ) end |