Sha256: 9d9bfedc1050a8e884e320aa38134fe311e7e1fffdce3eba0c4748f21eabc3c8

Contents?: true

Size: 733 Bytes

Versions: 19

Compression:

Stored size: 733 Bytes

Contents

require 'glimmer/dsl/expression'

module Glimmer
  module DSL
    module Opal
      class PropertyExpression < StaticExpression
        include TopLevelExpression

        def can_interpret?(parent, keyword, *args, &block)          
          parent and
            parent.respond_to?(:set_attribute) and
            parent.respond_to?(keyword, *args) and
            keyword and
            block.nil?
        end

        def interpret(parent, keyword, *args, &block)
          if keyword == 'text' # TODO move into property converters in element proxy
            args = [args.first.to_s.gsub('&', '')]
          end
          parent.set_attribute(keyword, *args)
          args.first.to_s
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.10.3 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.10.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.10.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.10.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.9.3 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.9.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.9.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.9.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.8.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.5 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.4 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.3 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.7.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.6.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.6.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.5.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.5.0 lib/glimmer/dsl/opal/property_expression.rb