Class: RXaal::ShowHide

Inherits:
BoundArray show all
Includes:
Serializable
Defined in:
lib/show_hide.rb

Instance Attribute Summary collapse

Attributes inherited from BoundArray

#bound_class

Instance Method Summary collapse

Methods inherited from BoundArray

#+, #<<, #[]=

Constructor Details

#initialize(show) ⇒ ShowHide

Returns a new instance of ShowHide.



10
11
12
13
# File 'lib/show_hide.rb', line 10

def initialize(show)
  super(XaalElement)
  @show = show
end

Instance Attribute Details

#showObject (readonly)

Returns the value of attribute show.



7
8
9
# File 'lib/show_hide.rb', line 7

def show
  @show
end

Instance Method Details

#xaal_serialize(parent) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/show_hide.rb', line 15

def xaal_serialize(parent)
  e_name = @show ? "show" : "hide"
  e = Element.new e_name
  parent.elements << e
  e.attributes["type"] = @type
  each { |obj|
    t_obj = Element.new "object_ref"
    t_obj.attributes["id"] = obj.id
    e.elements << t_obj
  }
end