Class: Glimmer::DSL::Web::PropertyExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::Web::PropertyExpression
- Defined in:
- lib/glimmer/dsl/web/property_expression.rb
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
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/glimmer/dsl/web/property_expression.rb', line 9 def can_interpret?(parent, keyword, *args, &block) # TODO add this condition once formatting elements become normal elements # or delete this line if no longer needed: # parent.is_a?(Glimmer::Web::FormattingElementProxy) || # Also, consider removing type check altogether (to generalize if good idea) ( parent.is_a?(Glimmer::Web::ElementProxy) || parent.is_a?(Glimmer::Web::Component) ) and (!args.empty?) and parent.respond_to?("#{keyword}=") and block.nil? end |
#interpret(parent, keyword, *args, &block) ⇒ Object
23 24 25 26 |
# File 'lib/glimmer/dsl/web/property_expression.rb', line 23 def interpret(parent, keyword, *args, &block) parent.send("#{keyword}=", *args) args end |