Sha256: 2e7b2ef0a20da1e33412ff259a70f95e9b74950c04f7aa28d97a91c6588c8182

Contents?: true

Size: 339 Bytes

Versions: 1

Compression:

Stored size: 339 Bytes

Contents

class Dotremap::Property
  include Dotremap::XmlTree

  def initialize(attr, value, options = {})
    @attr = attr.to_s
    @value = value
    @options = options
  end
  attr_accessor :attr, :value

  def to_xml
    open_tag = @options.map { |a, v| "#{a}=\"#{v}\"" }.unshift(attr).join(" ")
    "<#{open_tag}>#{value}</#{attr}>"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dotremap-0.0.8 lib/dotremap/property.rb