Sha256: 582fc55afaaf198715a0bc42fbc7a65f5a3745607964a4945d30137f40acf85a

Contents?: true

Size: 341 Bytes

Versions: 8

Compression:

Stored size: 341 Bytes

Contents

class Karabiner::Property
  include Karabiner::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

8 entries across 8 versions & 1 rubygems

Version Path
karabiner-0.4.0 lib/karabiner/property.rb
karabiner-0.3.1 lib/karabiner/property.rb
karabiner-0.3.0 lib/karabiner/property.rb
karabiner-0.2.1 lib/karabiner/property.rb
karabiner-0.2.0 lib/karabiner/property.rb
karabiner-0.1.2 lib/karabiner/property.rb
karabiner-0.1.1 lib/karabiner/property.rb
karabiner-0.1.0 lib/karabiner/property.rb