Class: Glimmer::DSL::BindExpression
- Inherits:
-
StaticExpression
- Object
- Expression
- StaticExpression
- Glimmer::DSL::BindExpression
- Defined in:
- lib/glimmer/dsl/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
Methods inherited from StaticExpression
Methods inherited from Expression
#add_content, #textual?, #widget?
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/glimmer/dsl/bind_expression.rb', line 11 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
28 29 30 31 32 |
# File 'lib/glimmer/dsl/bind_expression.rb', line 28 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 |