Class: Glimmer::DSL::Opal::TableItemsDataBindingExpression

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

Overview

Depends on BindCommandHandler and TableColumnPropertiesDataBindingCommandHandler

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
# File 'lib/glimmer/dsl/opal/table_items_data_binding_expression.rb', line 11

def can_interpret?(parent, keyword, *args, &block)
  keyword == "items" and
    block.nil? and
    parent.is_a?(Glimmer::SWT::TableProxy) and
    args.size.between?(1, 2) and
    args[0].is_a?(DataBinding::ModelBinding) and
    args[0].evaluate_property.is_a?(Array) and
    (args[1].nil? or args[1].is_a?(Array))
end

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



21
22
23
24
25
# File 'lib/glimmer/dsl/opal/table_items_data_binding_expression.rb', line 21

def interpret(parent, keyword, *args, &block)
  model_binding = args[0]
  column_properties = args[1]
  DataBinding::TableItemsBinding.new(parent, model_binding, column_properties)
end