Sha256: 34a9f73a4a7ebf718603bd24d085a9b6831dcb55015c2b10d2f3525f7a565dfd

Contents?: true

Size: 612 Bytes

Versions: 49

Compression:

Stored size: 612 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?
      @value != true
    end


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

  end

end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
dryml-2.0.0.pre8 lib/dryml/parser/attribute.rb
dryml-1.3.3 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre7 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre6 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre5 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre4 lib/dryml/parser/attribute.rb
dryml-1.3.2 lib/dryml/parser/attribute.rb
dryml-1.3.1 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre3 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre2 lib/dryml/parser/attribute.rb
dryml-2.0.0.pre1 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre8 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre7 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre6 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre5 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre4 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre3 lib/dryml/parser/attribute.rb
dryml-1.4.0.pre2 lib/dryml/parser/attribute.rb
dryml-1.1.0 lib/dryml/parser/attribute.rb
dryml-1.3.0 lib/dryml/parser/attribute.rb