Class: Keyremac::Raw

Inherits:
Object
  • Object
show all
Includes:
Container
Defined in:
lib/keyremac/dump.rb,
lib/keyremac/base.rb

Overview

container

Instance Attribute Summary

Attributes included from Container

#children

container collapse

Instance Method Summary collapse

Methods included from Container

#add, #method_missing

Constructor Details

#initialize(tag, children = []) ⇒ Raw

Returns a new instance of Raw.



73
74
75
76
# File 'lib/keyremac/base.rb', line 73

def initialize(tag, children = [])
  @tag = tag
  @children = children
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Keyremac::Container

Instance Method Details

#dump(xml) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/keyremac/dump.rb', line 64

def dump(xml)
  if @children.class == String
    xml.tag! @tag, @children
  else
    xml.tag! @tag do
      @children.each { |child|
        child.dump xml
      }
    end
  end
end