Class: UU::OS::GVC::TableRow

Inherits:
Object
  • Object
show all
Defined in:
uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb

Overview

Table row class, it is used as return type in some Table methods.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (TableRow) initialize(data = nil)

Creates new instance of TableRow.

Parameters:

  • data (String, Hash) (defaults to: nil)

    Initialization data in form of JSON string or Hash (optional)



41
42
43
44
45
46
47
48
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb', line 41

def initialize(data = nil)

  if data.kind_of?Hash
    @attributes = data
  elsif data.kind_of?String
    @attributes = JSON.parse(data, :symbolize_names => true)
  end
end

Instance Attribute Details

- (String) code (readonly)

Table row code. Read only.

Examples:

# get table row
table = view.get_components_by_code("table")[0]
row = table.get_row(2)

# hide row
code = row.code # table code as string "row3"

Returns:

  • (String)


36
37
38
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb', line 36

def code
  @code
end

- (Boolean) visible

Flag if row is visible in form. Default is true. If is set to false row is completely hidden.

Examples:

# get table row
table = view.get_components_by_code("table")[0]
row = table.get_row(2)

# hide row
row.visible = false

# make row visible again
row.visible = true

Returns:

  • (Boolean)


23
24
25
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb', line 23

def visible
  @visible
end

Instance Method Details

- (String) to_json(options = {})

Returns attributes representation as JSON String.

Returns:

  • (String)

    Attributes in JSON String.



53
54
55
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb', line 53

def to_json(options = {})
  attributes.to_json(options)
end

- (String) to_s

Returns attributes representation as JSON String.

Returns:

  • (String)

    Attributes in JSON String.



60
61
62
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table_row.rb', line 60

def to_s
  to_json
end