Class: Glimmer::DSL::Web::ClassNameInclusionDataBindingExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/glimmer/dsl/web/class_name_inclusion_data_binding.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/glimmer/dsl/web/class_name_inclusion_data_binding.rb', line 7

def can_interpret?(parent, keyword, *args, &block)
  keyword == 'class_name' &&
    block.nil? &&
    args.size == 1 &&
    textual?(args.first)
end

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



14
15
16
17
# File 'lib/glimmer/dsl/web/class_name_inclusion_data_binding.rb', line 14

def interpret(parent, keyword, *args, &block)
  parent_attribute = "#{keyword}_#{args.first.to_s}"
  Glimmer::DataBinding::Shine.new(parent, parent_attribute)
end