Class: UU::OS::GVC::Widget

Inherits:
Component show all
Defined in:
uu_os_gvc-0.28.16/lib/uu/os/gvc/widget.rb

Overview

Widget component.

Instance Attribute Summary (collapse)

Attributes inherited from Component

#attributes, #code, #component_type, #form, #height, #id, #name, #width

Instance Method Summary (collapse)

Methods inherited from Component

#add_message, #focus, #initialize, #messages

Constructor Details

This class inherits a constructor from UU::OS::GVC::Component

Instance Attribute Details

- (String) widget_code (readonly)

The code (type) of the widget.

Returns:

  • (String)


13
14
15
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/widget.rb', line 13

def widget_code
  @widget_code
end

Instance Method Details

- (Object) get_attribute(name)

Returns the value of the attribute or nil.

Parameters:

  • name (String)

    The name of the attribute whose value to return.

Returns:

  • (Object)

    The value of the attribute or nil.



28
29
30
31
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/widget.rb', line 28

def get_attribute(name)
  return attributes[name.downcase.to_sym] if !attributes.has_key?(name.to_sym) # backward compatibility
  attributes[name.to_sym]
end

- (Object) set_attribute(name, value)

Sets attribute with given name to given value.

Parameters:

  • name (String)

    The name of the attribute to set.

  • value (Object)

    The value of the attribute to set.



19
20
21
22
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/widget.rb', line 19

def set_attribute(name, value)
  attributes[name.downcase.to_sym] = nil # backward compatibility
  attributes[name.to_sym] = value
end