Sha256: f4063c971cd52f964f60bacaab53690b81c633496b5c9b4ae258636f6ec55680

Contents?: true

Size: 754 Bytes

Versions: 32

Compression:

Stored size: 754 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
            (!args.empty?) 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

32 entries across 32 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.28.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.28.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.28.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.27.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.26.3 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.26.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.26.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.26.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.25.4 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.25.3 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.25.2 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.25.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.25.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.24.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.23.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.22.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.22.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.21.0 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.20.1 lib/glimmer/dsl/opal/property_expression.rb
glimmer-dsl-opal-0.20.0 lib/glimmer/dsl/opal/property_expression.rb