Sha256: 54df5f7d433bce7c81ef7ccd916091acc507b8dbd18048dc3be06bcb32f206dd

Contents?: true

Size: 615 Bytes

Versions: 18

Compression:

Stored size: 615 Bytes

Contents

module Dryml::Parser

  class Attribute < REXML::Attribute

    def initialize(first, second=nil, parent=nil)
      super
      if first.is_a?(String) && second == true
        @value = true
      end
    end

    def value
      if has_rhs?
        super
      else
        element.document.default_attribute_value
      end
    end

    def to_string
      if has_rhs?
        super
      else
        @expanded_name
      end
    end

    def has_rhs?
      !defined?(@value)
    end


    # Override to supress Text.check call
    def element=( element )
      @element = element
      self
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dryml-2.2.6 lib/dryml/parser/attribute.rb
dryml-2.2.5 lib/dryml/parser/attribute.rb
dryml-2.2.4 lib/dryml/parser/attribute.rb
dryml-2.2.3 lib/dryml/parser/attribute.rb
dryml-2.2.2 lib/dryml/parser/attribute.rb
dryml-2.2.1 lib/dryml/parser/attribute.rb
dryml-2.2.0 lib/dryml/parser/attribute.rb
dryml-2.1.2 lib/dryml/parser/attribute.rb
dryml-2.1.1 lib/dryml/parser/attribute.rb
dryml-2.1.0 lib/dryml/parser/attribute.rb
dryml-2.1.0.pre4 lib/dryml/parser/attribute.rb
dryml-2.1.0.pre3 lib/dryml/parser/attribute.rb
dryml-2.1.0.pre2 lib/dryml/parser/attribute.rb
dryml-2.1.0.pre1 lib/dryml/parser/attribute.rb
dryml-2.0.1 lib/dryml/parser/attribute.rb
dryml-2.0.0 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre10 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre9 lib/dryml/parser/attribute.rb