Sha256: 042d163b6f0e34a11cbf3b2cfdf42d2e4504632401f8d99a8da893df2c935b34

Contents?: true

Size: 618 Bytes

Versions: 23

Compression:

Stored size: 618 Bytes

Contents

module Hobo::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

23 entries across 23 versions & 1 rubygems

Version Path
hobo-1.0.3 lib/hobo/dryml/parser/attribute.rb
hobo-1.0.2 lib/hobo/dryml/parser/attribute.rb
hobo-1.0.1 lib/hobo/dryml/parser/attribute.rb
hobo-1.0.0 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.106 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.105 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.104 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.103 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.102 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.101 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.100 lib/hobo/dryml/parser/attribute.rb
hobo-0.9.0 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.10 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.9 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.8 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.5 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.3 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.2 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.1 lib/hobo/dryml/parser/attribute.rb
hobo-0.8.4 lib/hobo/dryml/parser/attribute.rb